MCPcopy Index your code
hub / github.com/pydata/xarray / test_del_child

Method test_del_child

xarray/tests/test_treenode.py:265–275  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

263
264class TestPruning:
265 def test_del_child(self) -> None:
266 john: TreeNode = TreeNode()
267 mary: TreeNode = TreeNode()
268 john._set_item("Mary", mary)
269
270 del john["Mary"]
271 assert "Mary" not in john.children
272 assert mary.parent is None
273
274 with pytest.raises(KeyError):
275 del john["Mary"]
276
277
278def create_test_tree() -> tuple[NamedNode, NamedNode]:

Callers

nothing calls this directly

Calls 2

_set_itemMethod · 0.95
TreeNodeClass · 0.90

Tested by

no test coverage detected