mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add isort pre-commit hook, sort imports in src and test directories
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user