diff --git a/pytests/pyproject.toml b/pytests/pyproject.toml index 920455ca871..126eaf77b09 100644 --- a/pytests/pyproject.toml +++ b/pytests/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ [project.optional-dependencies] dev = [ - "gevent>=22.10.2", + "gevent>=22.10.2; implementation_name == 'cpython'", "hypothesis>=3.55", "pytest-asyncio>=0.21", "pytest-benchmark>=3.4", diff --git a/pytests/tests/test_misc.py b/pytests/tests/test_misc.py index 2f6cee6354e..6645f942f1a 100644 --- a/pytests/tests/test_misc.py +++ b/pytests/tests/test_misc.py @@ -2,7 +2,6 @@ import platform import sys -import gevent import pyo3_pytests.misc import pytest @@ -83,6 +82,8 @@ def __del__(self): def test_gevent(): + gevent = pytest.importorskip("gevent") + def worker(worker_id: int) -> None: for iteration in range(2): d = {"key": ArbitraryClass(worker_id, iteration)}