Skip to content

Commit 26e293f

Browse files
authored
Skip time-machine dep and spinner tests on PyPy (#2797)
The time-machine package is deeply relying on CPython implementation details and causes segfaults on PyPy. Pull the dependency in only on implementations other than PyPy, and skip collecting the spinner tests on PyPy since they require it.
1 parent bfba43c commit 26e293f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

docs/changelog/2797.misc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Skip the ``time-machine`` dependency and spinner tests on PyPy because
2+
it segfaults on this implementation.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ optional-dependencies.testing = [
5959
"pytest-mock>=3.10",
6060
"pytest-xdist>=3.1",
6161
"re-assert>=1.1",
62-
"time-machine>=2.8.2",
62+
"time-machine>=2.8.2; implementation_name != \"pypy\"",
6363
]
6464
scripts.tox = "tox.run:run"
6565
dynamic = ["version"]

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ def _fmt(msg: str) -> str:
3939
from typing_extensions import Protocol
4040

4141

42+
collect_ignore = []
43+
if sys.implementation.name == "pypy":
44+
# time-machine causes segfaults on PyPy
45+
collect_ignore.append("util/test_spinner.py")
46+
47+
4248
class ToxIniCreator(Protocol):
4349
def __call__(self, conf: str, override: Sequence[Override] | None = None) -> Config: # noqa: U100
4450
...

0 commit comments

Comments
 (0)