From 6915be31ca65262a8d3abfc55d5af5d78a0575e0 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Tue, 18 Aug 2026 15:50:45 +0200 Subject: [PATCH] fix(tests): match postgres_host assertion to the fixture actually in effect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/conftest.py sets os.environ["POSTGRES_HOST"] = "postgres-shared" at module level (before `from src.main import app`), commented "Use real postgres for integration tests". test_settings_loads_from_environment asserted settings.postgres_host == "test-postgres", a value grep confirms nothing in this suite has ever set — git log -p shows both the conftest line and this assertion originate in the same single commit and neither has changed since. Matched the assertion to the environment the suite actually runs under. Not a source change and not a claim that "postgres-shared" is the right fixture value for a suite this ticket also found is not actually hermetic where that value is concerned (see the 12 pre-existing DNS errors, tracked separately from this fix) — only that the assertion should test what the fixture sets, not an unset value. --- tests/test_integration.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index 2166d70..940b136 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -170,8 +170,13 @@ class TestConfigValidation: settings = get_settings() - # Should have loaded test environment variables - assert settings.postgres_host == "test-postgres" + # Should have loaded test environment variables. tests/conftest.py + # sets POSTGRES_HOST="postgres-shared" (module-level, before `from + # src.main import app`), annotated "Use real postgres for integration + # tests" — this assertion checked for "test-postgres", a value + # nothing in the suite has ever set. Matched to the fixture actually + # in effect rather than to an unset value. + assert settings.postgres_host == "postgres-shared" assert settings.postgres_db == "test_scheduler" assert settings.scheduler_api_key == "test-api-key-12345"