The hardest test suite I ever built - a pytest case study - Grzegorz Kocjan @EuroPythonConference
The hardest test suite I ever built - a pytest case study - Grzegorz Kocjan  @EuroPythonConference
Uploaded August 2026 | Updated September 2026, 2 weeks ago
[EuroPython 2026 - S2 on 2026-07-15]
🎤 *The hardest test suite I ever built - a pytest case study by Grzegorz Kocjan*
🔗 https://ep2026.europython.eu/session/the-hardest-test-suite-i-ever-built-a-pytest-case-study

📝 Abstract:
For years, this real-time video system had no tests. Every change produced unpredictable side effects. Accuracy drifted. Production incidents and escalations followed. The only “verification” was manual inspection and hope.

When I joined the project, this was the reality - and building a proper integration test suite became my first priority.

In this talk, I’ll share how I designed and evolved the hardest integration test suite of my career using pytest - and kept it readable.

The system processed live streams in production. It was non-deterministic. Individual detections were only 80–90% accurate. For testing, we replayed recorded scenarios to make system behavior observable and comparable across runs. But binary assertions were not enough. A single failed event did not mean the whole system was broken - but we needed a way to measure when it actually was.

Instead of writing one massive test, I built a layered architecture:

- dual parametrization - recording scope and event scope
- orchestration in fixtures - assertions in tiny, single-purpose tests
- statistics collection during execution
- end-of-run aggregation that summarizes system accuracy

The result was a suite that could detect regressions in model changes and produce reproducible evidence - HTML reports, structured dumps, and a summary statistics file.

This talk explores how far pytest can be stretched beyond unit tests - into a framework for architecting complex integration systems.

---
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: creativecommons.org/licenses/by-nc-sa/4.0
The hardest test suite I ever built - a pytest case study - Grzegorz KocjanFlying in Formation - with Python Threading and ROS2 Parallelism - DEBORAH E DANJUMAWill you be joining us at our tutorials on Monday and Tuesday in Kraków? Stefanie Molin will be teacWhat Ive Learned Maintaining the MCP Python SDK - Marcelo TrylesinskiWhy should YOU come to #EuroPython2026Why doing difficult things is good for you and good for your team - Katie BickfordEuroPython 2026 - Conference Closing 🐍Keynote: Securing Python for the next decade - William WoodruffHow we write unit test in my team in Openchip - Jan KoprowskiA new safe external debugger interface for CPython — Pablo Galindo SalgadoMIDI, those cheesy sounds from the 90s? Wrong! Symbolic music vs Python — Mateusz ModrzejewskiKeynote: The Boom of Generative AI: realities, promises and awkward situations — Nerea Luis
EuroPython Conference |

The hardest test suite I ever built - a pytest case study - Grzegorz Kocjan

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER