Skip to content

Commit 40ce664

Browse files
author
test
committed
test: fix settings-mock leak that failed SESSION_MAX_AGE_SECONDS tests in CI
The shared mock_settings fixture replaced settings with a MagicMock lacking SESSION_MAX_AGE_SECONDS, so create_app()'s SessionMiddleware wiring and the session-max-age assertions saw a MagicMock instead of an int under certain test orderings (green locally with tests/integration ignored, red in full CI). Give the mock a real SESSION_MAX_AGE_SECONDS (28800) so numeric reads/comparisons hold. Full CI unit suite now passes locally: 4076 passed.
1 parent b1409ac commit 40ce664

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

operations-manager/python/tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ def mock_settings() -> Any:
119119
mock_settings.KEYCLOAK_URL = ""
120120
mock_settings.PROMETHEUS_EXTERNAL_URL = ""
121121
mock_settings.PROMETHEUS_URL = ""
122+
# Real int, not a bare MagicMock: create_app() reads this to wire SessionMiddleware,
123+
# and numeric comparisons on it must work even when this mock is in effect.
124+
mock_settings.SESSION_MAX_AGE_SECONDS = 28800
122125
yield mock_settings
123126

124127

0 commit comments

Comments
 (0)