Skip to content

Commit

Permalink
Add a missing test case for '--validator-class'
Browse files Browse the repository at this point in the history
  • Loading branch information
sirosen committed Jul 8, 2024
1 parent 245bf10 commit b016212
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/acceptance/test_custom_validator_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,28 @@ def test_custom_validator_class_can_pass_when_valid(run_line, tmp_path):
],
)
assert result.exit_code == 0 # pass


@pytest.mark.parametrize(
"add_opts",
(
["--builtin-schema", "vendor.github-workflows"],
["--check-metaschema"],
),
)
def test_custom_validator_class_is_incompatible_with_schema_opts(
run_line, tmp_path, add_opts
):
doc = tmp_path / "instance.json"
doc.write_text("{}")
result = run_line(
[
"check-jsonschema",
"--validator-class",
"foo:MyValidator",
str(doc),
]
+ add_opts
)
assert result.exit_code == 2
assert "--validator-class can only be used with --schemafile" in result.stderr

0 comments on commit b016212

Please sign in to comment.