🐛 fix(ci): map absolute coverage paths#651
Merged
Merged
Conversation
Cross-platform coverage jobs store installed package paths under each runner checkout. Relative aliases leave macOS paths unresolved when Ubuntu combines the artifacts. Match the tox installation suffix after any checkout root so coverage can map Unix and Windows artifacts to the source tree.
gaborbernat
added a commit
that referenced
this pull request
Jul 14, 2026
The `close_failure` fixture patches `filelock._api.os.close`, and `filelock._api.os` is the `os` module, so mocking it swaps `os.close` for the whole process. While a test holds the mock, any `os.close` in the process raises `OSError`, including the ones a garbage collector runs inside a finalizer. CPython hides this. Refcounting reclaims lock objects as soon as a test drops them, outside the window the mock covers. PyPy reclaims them whenever a cycle runs, so a collection can land inside that window. `BaseFileLock.__del__` then force-releases a lock an earlier test left held, its close hits the mock, and the `OSError` escapes the finalizer as an unraisable exception. Pytest reports it against whichever test happens to be running, which is how the `pypy3.11` job on #654 failed inside `test_context_group_handles_deep_body_context`, a test that touches none of this. The mock now raises for the descriptor the test captured through `on_acquired` and hands every other descriptor to the real `os.close`. The lock under test still fails to close, so the `close_error_policy` cases keep their meaning, and a collector running a finalizer mid-test stops tripping over an unrelated fd. This also drops `docs/changelog/coverage-path-remapping.bugfix.rst`. #651 changed how CI maps coverage paths across tox environments, which no user of the library can observe, and the slug filename does not render through the `:pr:` role that `issue_format` applies to every fragment.
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.
Combined coverage cannot read artifacts from another runner because the current aliases start at a relative
.toxdirectory. The failure affects the current main workflow and blocks otherwise successful pull requests.The aliases now match the tox installation suffix after any absolute checkout root. Coverage maps Unix
lib/<python>/site-packagesand WindowsLib/site-packagespaths back tosrc, following the coverage.py path remapping contract.