summaryrefslogtreecommitdiff
path: root/setuptools/_distutils/tests/test_sysconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/_distutils/tests/test_sysconfig.py')
-rw-r--r--setuptools/_distutils/tests/test_sysconfig.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/setuptools/_distutils/tests/test_sysconfig.py b/setuptools/_distutils/tests/test_sysconfig.py
index 66f92c2a..bfeaf9a6 100644
--- a/setuptools/_distutils/tests/test_sysconfig.py
+++ b/setuptools/_distutils/tests/test_sysconfig.py
@@ -297,3 +297,22 @@ class TestSysconfig:
cmd, env={**os.environ, "PYTHONPATH": distutils_path}
)
assert out == "True"
+
+ def test_get_python_inc_missing_config_dir(self, monkeypatch):
+ """
+ In portable Python installations, the sysconfig will be broken,
+ pointing to the directories where the installation was built and
+ not where it currently is. In this case, ensure that the missing
+ directory isn't used for get_python_inc.
+
+ See pypa/distutils#178.
+ """
+
+ def override(name):
+ if name == 'INCLUDEPY':
+ return '/does-not-exist'
+ return sysconfig.get_config_var(name)
+
+ monkeypatch.setattr(sysconfig, 'get_config_var', override)
+
+ assert os.path.exists(sysconfig.get_python_inc())