chore: Update pre-commit
This commit is contained in:
parent
5a16a2b14b
commit
92e758cab1
|
@ -3,7 +3,7 @@ default_language_version:
|
|||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.5.0
|
||||
rev: v3.2.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
|
@ -20,18 +20,18 @@ repos:
|
|||
- id: gitlint
|
||||
|
||||
- repo: https://github.com/adrienverge/yamllint
|
||||
rev: v1.21.0
|
||||
rev: v1.24.2
|
||||
hooks:
|
||||
- id: yamllint
|
||||
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: stable
|
||||
rev: 20.8b1
|
||||
hooks:
|
||||
- id: black
|
||||
types: [python]
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-isort
|
||||
rev: v4.3.21
|
||||
rev: v5.4.2
|
||||
hooks:
|
||||
- id: isort
|
||||
additional_dependencies: ["isort[pyproject]"]
|
||||
|
|
|
@ -58,7 +58,13 @@ def test_recursive_list():
|
|||
is_valid(True, instance)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("schema, draft, error", (([], None, "Invalid schema"), ({}, 5, "Unknown draft: 5"),))
|
||||
@pytest.mark.parametrize(
|
||||
"schema, draft, error",
|
||||
(
|
||||
([], None, "Invalid schema"),
|
||||
({}, 5, "Unknown draft: 5"),
|
||||
),
|
||||
)
|
||||
def test_initialization_errors(schema, draft, error):
|
||||
with pytest.raises(ValueError, match=error):
|
||||
JSONSchema(schema, draft)
|
||||
|
|
|
@ -56,7 +56,10 @@ def test_draft(filename, draft, schema, instance, expected, description):
|
|||
try:
|
||||
result = jsonschema_rs.is_valid(schema, instance, int(draft))
|
||||
assert result is expected, "[{filename}] {description}: {schema} | {instance}".format(
|
||||
description=description, schema=schema, instance=instance, filename=filename,
|
||||
description=description,
|
||||
schema=schema,
|
||||
instance=instance,
|
||||
filename=filename,
|
||||
)
|
||||
except ValueError:
|
||||
pytest.fail(
|
||||
|
|
Loading…
Reference in New Issue