summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Moore <p.f.moore@gmail.com>2023-04-21 17:05:49 +0100
committerPaul Moore <p.f.moore@gmail.com>2023-04-21 17:05:49 +0100
commit7ba5a625bc95599e6f564285af84f39d24c109f8 (patch)
tree832460d2302f3e792b07b0ac9c7910bf9e20319b /tests
parent87678eefec0ad4fc6083a5843e8080ad56e64196 (diff)
downloadpip-7ba5a625bc95599e6f564285af84f39d24c109f8.tar.gz
Revert "Merge pull request #11487 from pelson/feature/base-prefix-config"
This reverts commit 56e5fa3c0fd0544e7b5b9b89d9d7854b82d51242, reversing changes made to 2c09e9c760e67fd801b3e756357de3b3c82cd08d.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_configuration.py33
-rw-r--r--tests/unit/test_options.py2
2 files changed, 3 insertions, 32 deletions
diff --git a/tests/unit/test_configuration.py b/tests/unit/test_configuration.py
index b0d655d8f..c6b44d45a 100644
--- a/tests/unit/test_configuration.py
+++ b/tests/unit/test_configuration.py
@@ -24,17 +24,11 @@ class TestConfigurationLoading(ConfigurationMixin):
self.configuration.load()
assert self.configuration.get_value("test.hello") == "2"
- def test_base_loading(self) -> None:
- self.patch_configuration(kinds.BASE, {"test.hello": "3"})
-
- self.configuration.load()
- assert self.configuration.get_value("test.hello") == "3"
-
def test_site_loading(self) -> None:
- self.patch_configuration(kinds.SITE, {"test.hello": "4"})
+ self.patch_configuration(kinds.SITE, {"test.hello": "3"})
self.configuration.load()
- assert self.configuration.get_value("test.hello") == "4"
+ assert self.configuration.get_value("test.hello") == "3"
def test_environment_config_loading(self, monkeypatch: pytest.MonkeyPatch) -> None:
contents = """
@@ -113,15 +107,6 @@ class TestConfigurationLoading(ConfigurationMixin):
with pytest.raises(ConfigurationError, match=pat):
self.configuration.get_value("global.index-url")
- def test_overrides_normalization(self) -> None:
- # Check that normalized names are used in precedence calculations.
- # Reminder: USER has higher precedence than GLOBAL.
- self.patch_configuration(kinds.USER, {"test.hello-world": "1"})
- self.patch_configuration(kinds.GLOBAL, {"test.hello_world": "0"})
- self.configuration.load()
-
- assert self.configuration.get_value("test.hello_world") == "1"
-
class TestConfigurationPrecedence(ConfigurationMixin):
# Tests for methods to that determine the order of precedence of
@@ -148,13 +133,6 @@ class TestConfigurationPrecedence(ConfigurationMixin):
assert self.configuration.get_value("test.hello") == "0"
- def test_site_overides_base(self) -> None:
- self.patch_configuration(kinds.BASE, {"test.hello": "2"})
- self.patch_configuration(kinds.SITE, {"test.hello": "1"})
- self.configuration.load()
-
- assert self.configuration.get_value("test.hello") == "1"
-
def test_site_overides_user(self) -> None:
self.patch_configuration(kinds.USER, {"test.hello": "2"})
self.patch_configuration(kinds.SITE, {"test.hello": "1"})
@@ -169,13 +147,6 @@ class TestConfigurationPrecedence(ConfigurationMixin):
assert self.configuration.get_value("test.hello") == "1"
- def test_base_overides_user(self) -> None:
- self.patch_configuration(kinds.USER, {"test.hello": "2"})
- self.patch_configuration(kinds.BASE, {"test.hello": "1"})
- self.configuration.load()
-
- assert self.configuration.get_value("test.hello") == "1"
-
def test_user_overides_global(self) -> None:
self.patch_configuration(kinds.GLOBAL, {"test.hello": "3"})
self.patch_configuration(kinds.USER, {"test.hello": "2"})
diff --git a/tests/unit/test_options.py b/tests/unit/test_options.py
index 9e3a0a5d6..43d5fdd3d 100644
--- a/tests/unit/test_options.py
+++ b/tests/unit/test_options.py
@@ -587,7 +587,7 @@ class TestOptionsConfigFiles:
for _, val in cp.iter_config_files():
files.extend(val)
- assert len(files) == 5
+ assert len(files) == 4
@pytest.mark.parametrize(
"args, expect",