From f21ce173b81447542972e0ea764a8178c4092b3f Mon Sep 17 00:00:00 2001 From: Matthew Daubney Date: Fri, 25 Sep 2026 20:34:23 +0100 Subject: [PATCH] Tests don't inherit optional features from the local environment TestConfig pins FEDERATION_ENABLED off and LASTFM_API_KEY empty, so a developer's .env (e.g. federation switched on to try it locally) can't change what the "feature off" tests see. Tests that need a feature turn it on explicitly (FederatedTestConfig, lastfm_config). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW --- src/scrobbler/config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scrobbler/config.py b/src/scrobbler/config.py index b29ad68..667c759 100644 --- a/src/scrobbler/config.py +++ b/src/scrobbler/config.py @@ -76,3 +76,7 @@ class TestConfig(Config): "postgresql+psycopg://scrobbler:scrobbler@localhost:5432/scrobbler_test", ) START_METRICS_SERVER = False + # Tests never inherit optional features from a developer's .env or environment; + # tests that need them turn them on explicitly. + LASTFM_API_KEY = "" + FEDERATION_ENABLED = "0"