Skip to content

Commit 8917eee

Browse files
DaanDeMeyerbehrmann
authored andcommitted
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
1 parent b3bbeaa commit 8917eee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_parse_config(tmp_path: Path) -> None:
151151

152152
# Empty values on the CLIs resets non-collection based settings to their defaults and collection based settings to
153153
# empty collections.
154-
assert config.distribution == detect_distribution()[0]
154+
assert config.distribution == (detect_distribution()[0] or Distribution.custom)
155155
assert "MY_KEY" not in config.environment
156156
assert "my.cred" not in config.credentials
157157
assert config.repositories == []

0 commit comments

Comments
 (0)