Skip to content

Commit

Permalink
CI: Thanks mypy my best friend, my code was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Nov 15, 2023
1 parent 0c60d34 commit ba94e52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/units/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_parse_fail(self, catalog_data: dict[str, Any]) -> None:
"""
with pytest.raises((ValidationError, ValueError)) as exec_info:
AntaCatalog.parse(str(DATA_DIR / catalog_data["filename"]))
if exec_info.type == ValidationError:
if isinstance(exec_info.value, ValidationError):
assert catalog_data["error"] in exec_info.value.errors()[0]["msg"]
else:
assert catalog_data["error"] in str(exec_info)
Expand Down Expand Up @@ -257,7 +257,7 @@ def test_from_dict_fail(self, catalog_data: dict[str, Any]) -> None:
data = safe_load(file)
with pytest.raises((ValidationError, ValueError)) as exec_info:
AntaCatalog.from_dict(data)
if exec_info.type == ValidationError:
if isinstance(exec_info.value, ValidationError):
assert catalog_data["error"] in exec_info.value.errors()[0]["msg"]
else:
assert catalog_data["error"] in str(exec_info)
Expand Down

0 comments on commit ba94e52

Please sign in to comment.