Repository navigation
Only enable Memray options when the pytest plugin is installed - #5307
Merged
illia-v merged 3 commits intoOct 14, 2026
Merged
Conversation
illia-v
previously approved these changes
Oct 14, 2026
illia-v
requested review from
pquentin,
sethmlarson and
shazow
as code owners
October 14, 2026 21:46
illia-v
approved these changes
Oct 14, 2026
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.
The Python 3.15 and brotlipy jobs in CI run 38137864167 stop before collecting tests with
unrecognized arguments: --memray --hide-memray-summary.dev-baseexcludes pytest-memray whenpython_full_version >= '3.15', buttests_impl()enables its CLI options for final, GIL-enabled CPython on non-Windows platforms without checking whether the plugin was installed. The same noxfile blob is present on current main (5ebe9bf9f691646dcabdb259ffabfc6108ded5e8) and the failing run's head.Check
importlib.util.find_spec('pytest_memray')in the session's interpreter after installing dependencies, before adding Memray options. Keep the existing implementation, release-level, free-threading and Windows restrictions. This follows the installed dependency selection without duplicating its Python version ceiling. Coverage invocation, settings and thresholds are unchanged.Validation on macOS:
uvx nox -s test-3.14 -- test/test_util.py: 595 passed, 6 skipped, with pytest-memray installed and enabled.uvx nox -r --no-install -s test-3.14 -- test/test_util.py: 595 passed, 6 skipped, with neither Memray option passed.uvx nox -s test-3.15 -- test/test_util.py: 595 passed, 6 skipped on Python 3.15.0rc2.uvx nox -P 3.15 -s test_brotlipy -- test/test_response.py -k brotli: 3 passed, 13 skipped, 211 deselected on Python 3.15.0rc2 (the normal warning about brotlipy lacking decompression-bomb protection was emitted).git diff --check, and targetedmypy -m noxfilepassed.uvx nox -s mypycommand failed on an unchanged annotation insrc/urllib3/connection.py:150(Final can be only used as an outermost qualifier).Limits: no full test suite, aggregated coverage check, or Linux Python 3.15 final run was performed locally. The final-release missing-plugin branch was exercised with a mock session and real pytest; the available local Python 3.15 interpreter is an RC. The regression harness was temporary, not added to the repository's test suite.
Checked open PRs/issues for Memray, Python 3.15, brotlipy and the unrecognized-arguments error. The Memray search hits (#5226, #5237, #5162) do not change this gating; #5263 retains it. No duplicate fix was found.
This change and its validation were prepared with OpenAI Codex assistance. It is independent of #5286 and changes no timeout behavior.