Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Dec 11, 2023
1 parent 979291f commit 6791ad9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

# from hypothesis import given, settings, HealthCheck
# from hypothesis_jsonschema import from_schema
from pydantic import ValidationError
from pydantic import ValidationError as ValidationErrorV2
from pydantic.v1 import ValidationError as ValidationErrorV1

from menuinst._schema import BasePlatformSpecific, MenuItem, validate

Expand All @@ -14,10 +15,12 @@
# assert value


@pytest.mark.parametrize("path", (DATA / "jsons").glob("*.json"))
@pytest.mark.parametrize(
"path", [pytest.param(path, id=path.name) for path in sorted((DATA / "jsons").glob("*.json"))]
)
def test_examples(path):
if "invalid" in path.name:
with pytest.raises(ValidationError):
with pytest.raises((ValidationErrorV1, ValidationErrorV2)):
assert validate(path)
else:
assert validate(path)
Expand Down

0 comments on commit 6791ad9

Please sign in to comment.