Skip to content

Commit 00a1cce

Browse files
authored
Merge pull request #274 from python-openapi/copilot/sub-pr-273
Fix review issues: ValidationError assertion, clear_validate_cache import, GitHub Actions docs
2 parents 9227cca + 244a5c7 commit 00a1cce

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

benchmarks/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from benchmarks.cases import BenchmarkCase
1616
from benchmarks.cases import build_cases
17-
from openapi_schema_validator.shortcuts import _clear_validate_cache
17+
from openapi_schema_validator.shortcuts import clear_validate_cache
1818
from openapi_schema_validator.shortcuts import validate
1919

2020

@@ -64,7 +64,7 @@ def _measure_helper_validate_per_second(
6464
*,
6565
check_schema: bool,
6666
) -> float:
67-
_clear_validate_cache()
67+
clear_validate_cache()
6868
for _ in range(warmup):
6969
validate(
7070
case.instance,

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ To run all checks on all files, enter:
7373
7474
pre-commit run --all-files
7575
76-
Pre-commit check results are also attached to your PR through integration with Github Action.
76+
Pre-commit check results are also attached to your PR through integration with GitHub Actions.
7777

7878
Performance benchmark
7979
^^^^^^^^^^^^^^^^^^^^^

tests/unit/test_shortcut.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pytest
66
from jsonschema.exceptions import SchemaError
7+
from jsonschema.exceptions import ValidationError
78
from referencing import Registry
89
from referencing import Resource
910

@@ -141,7 +142,9 @@ def test_validate_skip_schema_check():
141142
validate("foo", schema)
142143

143144
if has_ecma_regex():
144-
with pytest.raises(Exception):
145+
with pytest.raises(
146+
ValidationError, match="is not a valid regular expression"
147+
):
145148
validate("foo", schema, check_schema=False)
146149
else:
147150
with pytest.raises(re.error):

0 commit comments

Comments
 (0)