Skip to content

Commit

Permalink
type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Sep 16, 2024
1 parent dc9e3bd commit 6456276
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xarray/tests/test_treenode.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,16 @@ def test_node_names(self):
NamedNode(name=0)

def test_names(self):
nn = NamedNode()
nn: NamedNode = NamedNode()
assert nn.name is None

nn = NamedNode(name="foo")
nn: NamedNode = NamedNode(name="foo")
assert nn.name == "foo"

nn.name = "bar"
assert nn.name == "bar"

nn = NamedNode(children={"foo": NamedNode()})
nn: NamedNode = NamedNode(children={"foo": NamedNode()})
assert nn.children["foo"].name == "foo"
with pytest.raises(
ValueError, match="cannot set the name of a node which already has a parent"
Expand Down

0 comments on commit 6456276

Please sign in to comment.