diff --git a/tests/unit/test_points_gate.py b/tests/unit/test_points_gate.py index 01c21a30a..6fc8e913e 100644 --- a/tests/unit/test_points_gate.py +++ b/tests/unit/test_points_gate.py @@ -206,9 +206,10 @@ class TestPointsGateGlobalsBinding: """Toggling _pg_module._points_gate_enabled must flip what the wrapper sees (proxy pattern), not just a stale local in the decorator closure. """ - import packages.middleware.points_gate as _pg from app.api.routes import generation_tasks + import packages.middleware.points_gate as _pg + monkeypatch.setattr(_pg, "_points_gate_enabled", lambda: True) # if the wrapper bound a stale local, this would still be False assert _pg._points_gate_enabled() is True