From 8917eeecf96c132614cccd36d7f3de1112f560a5 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 29 Jul 2024 12:26:51 +0200 Subject: [PATCH] Handle failure to detect the distribution in test_parse_config() If /usr/lib/os-release isn't available, we can't detect the current distribution, so let's make sure we handle that scenario as well by checking for Distribution.custom instead of None. Fixes #2921 --- tests/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 0f7ae2703..10f510579 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -151,7 +151,7 @@ def test_parse_config(tmp_path: Path) -> None: # Empty values on the CLIs resets non-collection based settings to their defaults and collection based settings to # empty collections. - assert config.distribution == detect_distribution()[0] + assert config.distribution == (detect_distribution()[0] or Distribution.custom) assert "MY_KEY" not in config.environment assert "my.cred" not in config.credentials assert config.repositories == []