Choosing the Right Pytest Fixture Scope for Expensive Resources
Decide the best pytest fixture scope for expensive resources: function, class, module, package, or session. Compare trade‑offs, see a concrete pattern with a session‑scoped container and function‑scoped cleanup, and verify isolation and speed.