mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
add test
This commit is contained in:
@@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
- Numbers in a descendant-combined selector no longer cause an error https://github.com/Textualize/textual/issues/1836
|
||||
- Fixed superfluous scrolling when focusing a docked widget https://github.com/Textualize/textual/issues/1816
|
||||
- Fixes walk_children which was returning more than one screen https://github.com/Textualize/textual/issues/1846
|
||||
- Fixed issue with watchers fired for detached nodes https://github.com/Textualize/textual/issues/1846
|
||||
|
||||
## [0.11.1] - 2023-02-17
|
||||
|
||||
|
||||
@@ -239,10 +239,9 @@ class Reactive(Generic[ReactiveType]):
|
||||
)
|
||||
)
|
||||
|
||||
if obj.is_attached:
|
||||
watch_function = getattr(obj, f"watch_{name}", None)
|
||||
if callable(watch_function):
|
||||
invoke_watcher(watch_function, old_value, value)
|
||||
watch_function = getattr(obj, f"watch_{name}", None)
|
||||
if callable(watch_function):
|
||||
invoke_watcher(watch_function, old_value, value)
|
||||
|
||||
# Process "global" watchers
|
||||
watchers: list[tuple[Reactable, Callable]]
|
||||
|
||||
@@ -11,6 +11,22 @@ skip_py310 = pytest.mark.skipif(
|
||||
)
|
||||
|
||||
|
||||
async def test_screen_walk_children():
|
||||
"""Test query only reports active screen."""
|
||||
|
||||
class ScreensApp(App):
|
||||
pass
|
||||
|
||||
app = ScreensApp()
|
||||
async with app.run_test() as pilot:
|
||||
screen1 = Screen()
|
||||
screen2 = Screen()
|
||||
pilot.app.push_screen(screen1)
|
||||
assert list(pilot.app.query("*")) == [screen1]
|
||||
pilot.app.push_screen(screen2)
|
||||
assert list(pilot.app.query("*")) == [screen2]
|
||||
|
||||
|
||||
async def test_installed_screens():
|
||||
class ScreensApp(App):
|
||||
SCREENS = {
|
||||
|
||||
Reference in New Issue
Block a user