~/talk

Climbing Out of Fixture Hell, Indirectly

Talkat PyCascades 2026 · 2026-03-21..03-22· [testing, python]
links:none on file
slides:none on file

Shows concrete pytest code using indirect=True parametrization to replace dozens of specialized fixtures with one consolidated fixture per data type, turning three duplicate tests into one and cutting a 6s total DB setup cost to ~2s by using a module-scoped connection + function-scoped data pattern. Demonstrates request.param usage, multi-param runs, default values and readable test ids, warns against multi-level indirection that creates a fixture maze, and recommends factory fixtures, lazy setup and avoiding a giant god fixture.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08Test simplicity as code grows
  3. 3:24Fixture explosion from state
  4. 5:25Indirect parameterization with PyTest
  5. 7:50Tests describe needs not setup
  6. 10:05Consolidate fixtures with indirect
  7. 12:03Limits of multi-level parameterization
  8. 14:25Fixture explosion versus maze
  9. 14:53Scope confusion in expensive fixtures
  10. 17:17Isolating mutable data in function scope
  11. 19:13Maintainable test clarity
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.