From 6731a4f8c7ddbd28598744cfd6a310b852d67eb4 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 17 Aug 2023 06:11:45 +0800 Subject: [PATCH] Additional test of post-removal registry status. --- core/tests/widgets/test_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/tests/widgets/test_base.py b/core/tests/widgets/test_base.py index f1b7c24889..0d101b530b 100644 --- a/core/tests/widgets/test_base.py +++ b/core/tests/widgets/test_base.py @@ -640,7 +640,8 @@ def test_remove_child(widget): assert child.parent == widget assert child.app == app assert child.window == window - assert app.widgets["child_id"] == child + assert app.widgets == {"widget_id": widget, "child_id": child} + assert window.widgets == {"widget_id": widget, "child_id": child} # Remove the child widget.remove(child) @@ -653,6 +654,10 @@ def test_remove_child(widget): assert child.app is None assert child.window is None + # child widget no longer exists in the app or widgets registries. + assert app.widgets == {"widget_id": widget} + assert window.widgets == {"widget_id": widget} + # The impl's remove_child has been invoked assert_action_performed_with(widget, "remove child", child=child._impl)