Skip to content

Commit 24e9575

Browse files
committed
Be able to run tests that error from the suite.
1 parent 51e5e0b commit 24e9575

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

referencing/tests/test_referencing_suite.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pytest
66

77
from referencing import Registry
8+
from referencing.exceptions import Unresolvable
89
import referencing.jsonschema
910

1011

@@ -39,4 +40,9 @@ def test_referencing_suite(test_path):
3940
)
4041
for test in loaded["tests"]:
4142
resolver = registry.resolver(base_uri=test.get("base_uri", ""))
42-
assert resolver.lookup(test["ref"]).contents == test["target"]
43+
44+
if test.get("error"):
45+
with pytest.raises(Unresolvable):
46+
resolver.lookup(test["ref"])
47+
else:
48+
assert resolver.lookup(test["ref"]).contents == test["target"]

0 commit comments

Comments
 (0)