chore: Update pre-commit

This commit is contained in:
Dmitry Dygalo 2020-08-28 21:39:41 +02:00
parent 5a16a2b14b
commit 92e758cab1
No known key found for this signature in database
GPG Key ID: E2FDD4885D799724
3 changed files with 15 additions and 6 deletions

View File

@ -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]"]

View File

@ -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)

View File

@ -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(