Skip to content

Commit f0153ba

Browse files
authored
test: Change syntax to backward compatible
1 parent 1ad053d commit f0153ba

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

tests/dag/test_construct.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,7 @@ def test_dataframe_to_dag_reverse():
181181
assert_dag_structure_root(dag)
182182
assert_dag_structure_root_attr(dag)
183183

184-
# flake8: noqa: E999
185184
@staticmethod
186-
@pytest.mark.skipif(
187-
sys.version_info < (3, 10), reason="requires python3.10 or higher"
188-
)
189185
def test_dataframe_to_dag_zero_attribute():
190186
from bigtree.utils.iterators import dag_iterator
191187

@@ -208,18 +204,17 @@ def test_dataframe_to_dag_zero_attribute():
208204
dag = dataframe_to_dag(data)
209205
assert_dag_structure_root(dag)
210206
for parent, _ in dag_iterator(dag):
211-
match parent.name:
212-
case "a":
213-
assert hasattr(
214-
parent, "value"
215-
), "Check a attribute, expected value attribute"
216-
assert parent.value == 0, "Check a value, expected 0"
217-
case "b":
218-
assert not hasattr(
219-
parent, "value"
220-
), "Check b attribute, expected no value attribute"
221-
case "c":
222-
assert parent.value == -1, "Check c value, expected -1"
207+
if parent.name == "a":
208+
assert hasattr(
209+
parent, "value"
210+
), "Check a attribute, expected value attribute"
211+
assert parent.value == 0, "Check a value, expected 0"
212+
elif parent.name == "b":
213+
assert not hasattr(
214+
parent, "value"
215+
), "Check b attribute, expected no value attribute"
216+
elif parent.name == "c":
217+
assert parent.value == -1, "Check c value, expected -1"
223218

224219
def test_dataframe_to_dag_empty_row_error(self):
225220
with pytest.raises(ValueError) as exc_info:

0 commit comments

Comments
 (0)