diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2023-02-06 18:40:51 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2023-02-06 18:40:51 -0500 |
| commit | 43c6ee4b2b2ce4637bb1a36400fbaa548150ec8b (patch) | |
| tree | a7cb3f207103241d8b3241724c45bc19aaa5991e /setuptools/_distutils/tests/test_sysconfig.py | |
| parent | 8032430d75cdfad9f9826d302d90cd7b23dea3ca (diff) | |
| parent | 8c3c3d29bda85afb7f86c23a8ba66f7519f79e88 (diff) | |
| download | python-setuptools-git-43c6ee4b2b2ce4637bb1a36400fbaa548150ec8b.tar.gz | |
Merge https://github.com/pypa/distutils into distutils-8c3c3d29
Diffstat (limited to 'setuptools/_distutils/tests/test_sysconfig.py')
| -rw-r--r-- | setuptools/_distutils/tests/test_sysconfig.py | 19 |
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()) |
