Skip to content

Commit e67aaaa

Browse files
author
Tooru
committed
Avoid jsonschema RefResolutionError warning
1 parent 80ecdd6 commit e67aaaa

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@
88

99
# Ensure tests never depend on a developer's real OpenRouter key from .env.
1010
os.environ.setdefault("OPENROUTER_API_KEY", "test-openrouter-api-key-1234567890")
11+
12+
try:
13+
import jsonschema
14+
from jsonschema.exceptions import _RefResolutionError
15+
16+
if "RefResolutionError" not in jsonschema.__dict__:
17+
jsonschema.RefResolutionError = _RefResolutionError # type: ignore[attr-defined]
18+
except Exception:
19+
pass

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ filterwarnings =
3636
#
3737
# Example (uncomment if needed):
3838
# ignore::DeprecationWarning:some_third_party_lib.*
39-
ignore:jsonschema\.exceptions\.RefResolutionError is deprecated.*:DeprecationWarning:schemathesis\.generation\.coverage
39+
ignore:jsonschema\.exceptions\.RefResolutionError is deprecated.*:DeprecationWarning

0 commit comments

Comments
 (0)