Skip to content

Commit 1a4cc49

Browse files
committed
Fix test assertion
1 parent 613aaef commit 1a4cc49

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_lib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ def test(entry):
4646

4747
if isinstance(entry.get("expected_match"), dict):
4848
result = pattern.exec(*entry["inputs"])
49-
assert result
5049

5150
for key in entry["expected_match"]:
5251
assert result[key] == entry["expected_match"][key]
5352

53+
else:
54+
result = pattern.exec(*entry["inputs"])
55+
assert result is None
56+
5457
if "exactly_empty_components" in entry:
5558
result = pattern.exec(*entry["inputs"])
5659

5760
for component in entry["exactly_empty_components"]:
5861
if result:
59-
assert result[component]["groups"] == {}
62+
assert result[component]["groups"] == {}

0 commit comments

Comments
 (0)