Skip to content

perf(tests): disable more unused pytest plugins - #1390

Open
henryiii wants to merge 2 commits into
pypa:mainfrom
henryiii:disable-unused-plugins
Open

perf(tests): disable more unused pytest plugins#1390
henryiii wants to merge 2 commits into
pypa:mainfrom
henryiii:disable-unused-plugins

Conversation

@henryiii

@henryiii henryiii commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

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 anyway
  • tmpdir: no IO means no reason to make tmpdir's
  • legacypath: 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:

  • threadexception wraps every test phase in catch contexts and forces several gc.collect() passes at shutdown; the suite spawns no threads.
  • tmpdir and legacypath back fixtures no test uses (tmp_path/tmpdir) and only add per-hook dispatch cost.

The unraisableexception plugin 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).

@henryiii
henryiii marked this pull request as draft August 16, 2026 14:00
@henryiii
henryiii marked this pull request as ready for review August 16, 2026 21:02
Comment thread pyproject.toml
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
@henryiii
henryiii force-pushed the disable-unused-plugins branch from 4a60c32 to 9fa2627 Compare August 16, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant