Skip to content

Commit 1d21c95

Browse files
SinclertGraemeWatt
authored andcommitted
Update JSON resolver tests
1 parent 06317c9 commit 1d21c95

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

testsuite/test_schema_resolver.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
import os
33
import pytest
44
from hepdata_validator.schema_resolver import JsonSchemaResolver
5-
from jsonschema.exceptions import RefResolutionError
5+
6+
# This is compatible both with Python2 and Python3
7+
try:
8+
FileNotFoundError
9+
except NameError: # pragma: no cover
10+
FileNotFoundError = IOError # pragma: no cover
611

712

813
####################################################
@@ -71,5 +76,5 @@ def test_json_resolver_non_existing_schema(json_resolver):
7176

7277
file_name = "random_name.json"
7378

74-
with pytest.raises(RefResolutionError):
79+
with pytest.raises(FileNotFoundError):
7580
json_resolver.resolve(file_name)

0 commit comments

Comments
 (0)