Skip to content

Commit de01d8b

Browse files
ci: Remove jsonschema from requirements-testing.txt (#6620)
Remove the package from `requirements-testing.txt` and add it only as a dependency of the test suites that rely on it. This is part of environment cleanup before moving the remaining testing dependencies to a uv dependency group.
1 parent bf61e8c commit de01d8b

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

requirements-testing.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pytest-cov
33
pytest-forked
44
pytest-localserver
55
pytest-timeout
6-
jsonschema
76
executing
87
asttokens
98
responses

scripts/populate_tox/tox.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ deps =
8080
# === Common ===
8181
py3.8-common: hypothesis
8282
common: brotli
83+
common: jsonschema
8384
common: pysocks
8485
common: pytest-asyncio
8586
common: httpcore[asyncio]
@@ -101,6 +102,7 @@ deps =
101102
{py3.6,py3.7}-gevent: pytest<7.0.0
102103
{py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest
103104
gevent: brotli
105+
gevent: jsonschema
104106
gevent: pysocks
105107
gevent: pytest-asyncio
106108
gevent: setuptools<82

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
except ImportError:
1919
brotli = None
2020

21-
import jsonschema
21+
try:
22+
import jsonschema
23+
except ImportError:
24+
jsonschema = None
25+
2226
import pytest
2327
from pytest_localserver.http import WSGIServer
2428
from werkzeug.wrappers import Request, Response
@@ -236,6 +240,7 @@ def _capture_internal_warnings():
236240
@pytest.fixture
237241
def validate_event_schema(tmpdir):
238242
def inner(event):
243+
assert jsonschema is not None
239244
if SENTRY_EVENT_SCHEMA:
240245
jsonschema.validate(instance=event, schema=SENTRY_EVENT_SCHEMA)
241246

tox.ini

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)