test: skip tkinter scheduler tests on PyPy (all platforms)#760
Merged
test: skip tkinter scheduler tests on PyPy (all platforms)#760
Conversation
The module creates `tkinter.Tk()` at import time. During PyPy interpreter shutdown, `_tkinter/app.py`'s `__del__` calls `threading.notify_all`, which can abort the process with `Fatal Python error: Aborted`. When this happens inside an xdist worker it takes the worker down and fails whichever unrelated test happens to be running (e.g. test_case_three), showing up as a non-deterministic CI failure. The skip guard previously only covered macOS+PyPy; extend it to all PyPy platforms so the Linux PyPy job stops flaking. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collapse the `pytest.skip(...)` call onto a single line per ruff-format. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tkinter.Tk()intest_tkinterscheduler.pytriggers a PyPy interpreter-shutdown crash:_tkinter/app.py__del__→threading.notify_all→Fatal Python error: Aborted. Inside an xdist worker this kills the worker and fails whichever unrelated test it was running.Example of the failure (from #757's run):
test_case_threehas nothing to do with tkinter — it just happened to be on the worker when tkinter's finalizer aborted.Test plan
Fatal Python error: Aborted.pytest.importorskip(\"tkinter\")still runs on CPython, so tkinter tests execute where a display is available and skip otherwise.🤖 Generated with Claude Code