Skip to content

Commit

Permalink
Skip time-machine dep and spinner tests on PyPy (#2797)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgorny committed Dec 31, 2022
1 parent bfba43c commit 26e293f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changelog/2797.misc.rst
@@ -0,0 +1,2 @@
Skip the ``time-machine`` dependency and spinner tests on PyPy because
it segfaults on this implementation.
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -59,7 +59,7 @@ optional-dependencies.testing = [
"pytest-mock>=3.10",
"pytest-xdist>=3.1",
"re-assert>=1.1",
"time-machine>=2.8.2",
"time-machine>=2.8.2; implementation_name != \"pypy\"",
]
scripts.tox = "tox.run:run"
dynamic = ["version"]
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Expand Up @@ -39,6 +39,12 @@ def _fmt(msg: str) -> str:
from typing_extensions import Protocol


collect_ignore = []
if sys.implementation.name == "pypy":
# time-machine causes segfaults on PyPy
collect_ignore.append("util/test_spinner.py")


class ToxIniCreator(Protocol):
def __call__(self, conf: str, override: Sequence[Override] | None = None) -> Config: # noqa: U100
...
Expand Down

0 comments on commit 26e293f

Please sign in to comment.