Add isort pre-commit hook, sort imports in src and test directories

This commit is contained in:
Darren Burns
2023-02-09 13:28:08 +00:00
parent 67c2127e46
commit 9287f64a66
131 changed files with 268 additions and 297 deletions

View File

@@ -16,15 +16,17 @@ async def test_installed_screens():
SCREENS = {
"home": Screen, # Screen type
"one": Screen(), # Screen instance
"two": lambda: Screen() # Callable[[], Screen]
"two": lambda: Screen(), # Callable[[], Screen]
}
app = ScreensApp()
async with app.run_test() as pilot:
pilot.app.push_screen("home") # Instantiates and pushes the "home" screen
pilot.app.push_screen("one") # Pushes the pre-instantiated "one" screen
pilot.app.push_screen("one") # Pushes the pre-instantiated "one" screen
pilot.app.push_screen("home") # Pushes the single instance of "home" screen
pilot.app.push_screen("two") # Calls the callable, pushes returned Screen instance
pilot.app.push_screen(
"two"
) # Calls the callable, pushes returned Screen instance
assert len(app.screen_stack) == 5
assert app.screen_stack[1] is app.screen_stack[3]
@@ -40,10 +42,8 @@ async def test_installed_screens():
pilot.app.pop_screen()
@skip_py310
async def test_screens():
app = App()
app._set_active()