perf(tests): disable more unused pytest plugins - #1390
Open
henryiii wants to merge 2 commits into
Open
Conversation
henryiii
marked this pull request as draft
August 16, 2026 14:00
henryiii
marked this pull request as ready for review
August 16, 2026 21:02
henryiii
commented
Aug 16, 2026
The threadexception plugin wraps every test phase in catch contexts and forces several gc.collect() passes at shutdown; the suite spawns no threads. The tmpdir and legacypath plugins back fixtures no test uses. The unraisableexception plugin stays enabled to catch __del__/finalizer bugs. Disabling the three saves ~3% of the suite runtime. Assisted-by: ClaudeCode:claude-fable-5
Signed-off-by: Henry Schreiner <[email protected]>
henryiii
force-pushed
the
disable-unused-plugins
branch
from
August 16, 2026 21:04
4a60c32 to
9fa2627
Compare
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.
Also fixes leaks of pytest configuration into the downstream tests by dropping a pytest.ini one level above the repo.
We could also drop unraisableexception, but that one's pretty easy to trigger by mistake, so best to keep it, I think.
This drops:
threadexception: we should not be making threads anywaytmpdir: no IO means no reason to make tmpdir'slegacypath: I'd forgotten we can opt out, that's great even if it didn't also save time.This saves about 0.5s or so out of 11s or so. For the full parallel no coverage run, it's 22s -> 21s.
🤖 AI text below 🤖
Disable three more builtin pytest plugins that this suite does not use:
threadexceptionwraps every test phase in catch contexts and forces severalgc.collect()passes at shutdown; the suite spawns no threads.tmpdirandlegacypathback fixtures no test uses (tmp_path/tmpdir) and only add per-hook dispatch cost.The
unraisableexceptionplugin stays enabled to catch__del__/finalizer bugs. This saves approximately 3% of the suite runtime (measured with a sampling profiler; test bodies are a small fraction of total wall time at this test count).