Skip to content

Conversation

@ngoldbaum
Copy link
Member

@ngoldbaum ngoldbaum commented Sep 1, 2025

Towards #29552. Ping @bwhitt7.

We'd like to use pytest-run-parallel more but the monkeypatch fixture gets detected by the plugin as a thread-unsafe fixture.

@ngoldbaum ngoldbaum added 05 - Testing 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) labels Sep 1, 2025
@ngoldbaum ngoldbaum changed the title TST: avoid monkeypatch fixture in global PYTHONHASHSEED fixture TST: avoid monkeypatch fixture in global env_setup fixture Sep 1, 2025
@seberg
Copy link
Member

seberg commented Sep 2, 2025

Is this still needed anymore?

Probably not, I think we should just try removing it. This was probably added at a time where dict iteration order was undefined, which is a time long gone by.

EDIT: Or maybe doctests/very specific tests, but I think then we can deal with it there as we notice issues.

@ngoldbaum ngoldbaum changed the title TST: avoid monkeypatch fixture in global env_setup fixture TST: delete global env_setup fixture Sep 2, 2025
@seberg
Copy link
Member

seberg commented Sep 2, 2025

Well, since all tests pass, let's put it in and see if someone actually notices :). Thanks Nathan!

@seberg seberg merged commit 29caecb into numpy:main Sep 2, 2025
76 checks passed
MaanasArora pushed a commit to MaanasArora/numpy that referenced this pull request Sep 10, 2025
delete global env_setup fixture that previously set `PYTHONHASHSEED` presumably for historical reasons (when dict order was random).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 - Testing 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants