MCPcopy
hub / github.com/Textualize/textual / test_clear

Function test_clear

tests/test_node_list.py:87–100  ·  view source on GitHub ↗

Can we clear the list?

()

Source from the content-addressed store, hash-verified

85
86
87async def test_clear():
88 """Can we clear the list?"""
89 nodes = NodeList()
90 assert len(nodes) == 0
91 widgets = [Widget() for _ in range(1000)]
92 for widget in widgets:
93 nodes._append(widget)
94 assert len(nodes) == 1000
95 for widget in widgets:
96 assert widget in nodes
97 nodes._clear()
98 assert len(nodes) == 0
99 for widget in widgets:
100 assert widget not in nodes
101
102
103async def test_listy():

Callers

nothing calls this directly

Calls 4

_appendMethod · 0.95
_clearMethod · 0.95
NodeListClass · 0.90
WidgetClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…