diff --git a/requirements-testing.txt b/requirements-testing.txt index 3cac3c91ba..eefe6e7c2e 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -3,7 +3,6 @@ pytest-cov pytest-forked pytest-localserver pytest-timeout -jsonschema executing asttokens responses diff --git a/scripts/populate_tox/tox.jinja b/scripts/populate_tox/tox.jinja index b91f9d0b45..95a4335019 100644 --- a/scripts/populate_tox/tox.jinja +++ b/scripts/populate_tox/tox.jinja @@ -80,6 +80,7 @@ deps = # === Common === py3.8-common: hypothesis common: brotli + common: jsonschema common: pysocks common: pytest-asyncio common: httpcore[asyncio] @@ -101,6 +102,7 @@ deps = {py3.6,py3.7}-gevent: pytest<7.0.0 {py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest gevent: brotli + gevent: jsonschema gevent: pysocks gevent: pytest-asyncio gevent: setuptools<82 diff --git a/tests/conftest.py b/tests/conftest.py index c73bbdcbcc..eb5df6fa64 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,7 +18,11 @@ except ImportError: brotli = None -import jsonschema +try: + import jsonschema +except ImportError: + jsonschema = None + import pytest from pytest_localserver.http import WSGIServer from werkzeug.wrappers import Request, Response @@ -236,6 +240,7 @@ def _capture_internal_warnings(): @pytest.fixture def validate_event_schema(tmpdir): def inner(event): + assert jsonschema is not None if SENTRY_EVENT_SCHEMA: jsonschema.validate(instance=event, schema=SENTRY_EVENT_SCHEMA) diff --git a/tox.ini b/tox.ini index 5b21972349..2a03a81e39 100644 --- a/tox.ini +++ b/tox.ini @@ -403,6 +403,7 @@ deps = # === Common === py3.8-common: hypothesis common: brotli + common: jsonschema common: pysocks common: pytest-asyncio common: httpcore[asyncio] @@ -424,6 +425,7 @@ deps = {py3.6,py3.7}-gevent: pytest<7.0.0 {py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest gevent: brotli + gevent: jsonschema gevent: pysocks gevent: pytest-asyncio gevent: setuptools<82