summaryrefslogtreecommitdiff
path: root/tests/unit/test_configuration.py
diff options
context:
space:
mode:
authorXavier Fernandez <xav.fernandez@gmail.com>2019-07-20 22:29:24 +0200
committerGitHub <noreply@github.com>2019-07-20 22:29:24 +0200
commit645809944cb670433432b5279ffdc54f7bde3fd9 (patch)
tree70cbfda21ba2d3d21585726384ae79c64ed5db83 /tests/unit/test_configuration.py
parentc1eb1d76bae106a94980a5b33fc1a4e21b3d658d (diff)
downloadpip-645809944cb670433432b5279ffdc54f7bde3fd9.tar.gz
Move config files locations inside a function (#6736)
Diffstat (limited to 'tests/unit/test_configuration.py')
-rw-r--r--tests/unit/test_configuration.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/unit/test_configuration.py b/tests/unit/test_configuration.py
index 01a9a7779..f16252f44 100644
--- a/tests/unit/test_configuration.py
+++ b/tests/unit/test_configuration.py
@@ -6,11 +6,9 @@ import os
import pytest
from mock import MagicMock
+from pip._internal.configuration import get_configuration_files, kinds
from pip._internal.exceptions import ConfigurationError
-from pip._internal.locations import (
- global_config_files, new_config_file, site_config_file,
-)
-from tests.lib.configuration_helpers import ConfigurationMixin, kinds
+from tests.lib.configuration_helpers import ConfigurationMixin
class TestConfigurationLoading(ConfigurationMixin):
@@ -194,7 +192,9 @@ class TestConfigurationModification(ConfigurationMixin):
# get the path to site config file
assert mymock.call_count == 1
- assert mymock.call_args[0][0] == site_config_file
+ assert mymock.call_args[0][0] == (
+ get_configuration_files()[kinds.SITE][0]
+ )
def test_user_modification(self):
# get the path to local config file
@@ -209,7 +209,10 @@ class TestConfigurationModification(ConfigurationMixin):
# get the path to user config file
assert mymock.call_count == 1
- assert mymock.call_args[0][0] == new_config_file
+ assert mymock.call_args[0][0] == (
+ # Use new config file
+ get_configuration_files()[kinds.USER][1]
+ )
def test_global_modification(self):
# get the path to local config file
@@ -224,4 +227,6 @@ class TestConfigurationModification(ConfigurationMixin):
# get the path to user config file
assert mymock.call_count == 1
- assert mymock.call_args[0][0] == global_config_files[-1]
+ assert mymock.call_args[0][0] == (
+ get_configuration_files()[kinds.GLOBAL][-1]
+ )