r/softwaretesting • u/vzakaznikov • May 07 '26
Writing Test Programs, Not Just Tests – Beyond the runner, use Python code to naturally control test flow
Most test frameworks follow a "runner mentality"; you write test functions and hand them to a runner that controls discovery, execution order, and flow. The moment you need something dynamic (loop a test N times based on a runtime value, skip a test based on another's result), you're hunting for plugins. We present an alternative that is, in a way, a return to basics: treat your tests as a regular program. Dependencies become if statements. Retries become while loops. Parallel execution becomes a function argument. No plugins — just code, just Python. We use TestFlows (pip3 install testflows) to illustrate the idea, but the core argument is framework-independent: test code should have the same expressive power as production code. Have you hit the ceiling of your test runner? How do you handle dynamic test flows today? Read more: https://testflows.com/blog/writing-test-programs-not-just-tests/.
2
u/crowcanyonsoftware May 07 '26
Interesting take, a lot of test runners do feel limiting once you need dynamic flows. Treating tests like real code with loops and conditions makes a lot of sense for complex scenarios.
Curious if it’s been easier to maintain long-term or harder to standardize across a team?
1
u/Logical_Ordinary2745 May 07 '26
What? Pytest is not enough for you to handle all test run & management related things?
1
u/kaizokuuuu May 07 '26
I generally have an orchestrator that uses runners which allows me to cover all related usecases like parallel runs, multiple iterations etc and whatever else required. The test orchestrator wraps around multiple runners and allows fine-grained control. I'll try to open source the package, it does something similar where it builds a execution flow for tests
0
u/[deleted] May 07 '26
[deleted] — view deleted comment