Skip to content

refactor: consolidate fixture overrides in sessionstart - #148

Merged
adriencaccia merged 1 commit into
masterfrom
refactor/consolidate-fixture-sessionstart
Oct 31, 2026
Merged

adriencaccia merged 1 commit into
masterfrom
refactor/consolidate-fixture-sessionstart

Conversation

@art049

@art049 art049 commented Oct 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Move the legacy fixture override into the existing trylast pytest_sessionstart hook alongside the public registration path added in fix: support pytest 9.2 fixture manager changes #141.
  • Share the competing-plugin and CodSpeed-enabled guards; retain the pre-8.1.1 lookup and pre-9.1 private mapping fallback.
  • Remove pytest_plugin_registered and its unused FixtureManager import; update the changelog.

Verification

Isolated CLI smoke runs on pytest 8.0.2, 9.0.2, 9.1.1, and 9.2.0:

  • With pytest-benchmark 5.0.1: fixture identity verified and a walltime benchmark executed successfully on all four versions.
  • Without pytest-benchmark: fixture identity verified and a walltime benchmark executed successfully on all four versions.
  • With CodSpeed disabled and pytest-benchmark installed: passed on 8.0.2, 9.0.2, and 9.1.1. Pytest 9.2.0 encounters the known upstream pytest-benchmark Node._nodeid incompatibility documented in fix: support pytest 9.2 fixture manager changes #141.
  • uv run --no-sync ruff check src/pytest_codspeed/plugin.py passed.

@art049
art049 requested a review from adriencaccia October 30, 2026 17:37
@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable regressions were found.

Summary

Moves both benchmark fixture override paths into pytest_sessionstart.

  • One session-start hook now handles the benchmark fixture override across pytest versions.

No actionable issues were found.

Reviews (1) · Last reviewed commit: "refactor: consolidate fixture overrides ..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Oct 30, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.37%

3 warnings, 1 note

⚠️ 5 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 3 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚠️ 17 benchmarks with a significant change ran in a different software environment

Their base and head results were measured with a different OS or toolchain, such as compiler, runtime or library versions, so the changes might come from this difference rather than from the code. Open an affected benchmark to see what changed.

See affected benchmarks

ℹ️ 19 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 6 improved benchmarks
❌ 11 regressed benchmarks
✅ 260 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime test_count_even[count_even_fast] 1.1 ms 1.5 ms -23.2%
❌ Walltime test_noop_pass_decorated 674.5 ns 792.3 ns -14.86%
❌ Walltime test_sum_of_squares[sum_of_squares_for_loop_power] 189.9 µs 220.1 µs -13.73%
❌ Walltime test_multiprocessing_map[100000] 246.4 ms 284.8 ms -13.5%
❌ Memory test_multiprocessing_map[1000] 2.9 MB 3.4 MB -13.35%
❌ Walltime test_noop_lambda_decorated 1.2 µs 1.3 µs -11.13%
❌ Memory test_multiprocessing_map[10000] 3.2 MB 3.5 MB -8.18%
❌ Walltime test_sum_of_squares[sum_of_squares_sum_comprehension_power] 241.1 µs 258.2 µs -6.61%
❌ Walltime test_combination_sum[candidates0-8] 10.9 µs 11.6 µs -6.58%
❌ Walltime test_fs_read[1000] 833.7 ns 879 ns -5.15%
❌ Walltime test_is_complete[board0] 1.8 µs 1.9 µs -5.09%
⚡ Memory test_multiprocessing_map[10] 3.5 MB 3.2 MB +10.16%
⚡ Walltime test_solve_power_sum[13-2] 7.2 µs 6.8 µs +5.75%
⚡ Walltime test_mmap_operation[4096] 38.2 µs 36.1 µs +5.74%
⚡ Walltime test_sudoku[initial_grid0] 8.3 µs 7.9 µs +5.68%
⚡ Walltime test_multiprocessing_map[10] 48.6 ms 46.1 ms +5.42%
⚡ Walltime test_tcp_connection[wikipedia.org-443] 14.6 ms 13.9 ms +5.17%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing refactor/consolidate-fixture-sessionstart (9337786) with master (8f93e8f)

Open in CodSpeed

@adriencaccia
adriencaccia merged commit 1998c80 into master Oct 31, 2026
61 of 62 checks passed
@adriencaccia
adriencaccia deleted the refactor/consolidate-fixture-sessionstart branch October 31, 2026 07:56
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.

2 participants