mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Be 100% sure all removals take place
This commit is contained in:
@@ -122,7 +122,9 @@ async def test_widget_remove_order():
|
||||
await pilot.app.mount(
|
||||
Removable(Removable(Removable(id="grandchild"), id="child"), id="parent")
|
||||
)
|
||||
assert len(pilot.app.screen.walk_children(with_self=False)) == 3
|
||||
await pilot.app.screen.children[0].remove()
|
||||
assert len(pilot.app.screen.walk_children(with_self=False)) == 0
|
||||
assert removals == ["grandchild", "child", "parent"]
|
||||
|
||||
async def test_query_remove_order():
|
||||
@@ -138,5 +140,7 @@ async def test_query_remove_order():
|
||||
await pilot.app.mount(
|
||||
Removable(Removable(Removable(id="grandchild"), id="child"), id="parent")
|
||||
)
|
||||
assert len(pilot.app.screen.walk_children(with_self=False)) == 3
|
||||
await pilot.app.query(Removable).remove()
|
||||
assert len(pilot.app.screen.walk_children(with_self=False)) == 0
|
||||
assert removals == ["grandchild", "child", "parent"]
|
||||
|
||||
Reference in New Issue
Block a user