Skip to content

Commit f448b95

Browse files
committed
Add xfail test capturing missed expectation. Ref pypa/distutils#178.
1 parent 3e9d47e commit f448b95

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

distutils/tests/test_sysconfig.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,23 @@ def test_win_build_venv_from_source_tree(self, tmp_path):
297297
cmd, env={**os.environ, "PYTHONPATH": distutils_path}
298298
)
299299
assert out == "True"
300+
301+
@pytest.mark.xfail(reason="#178")
302+
def test_get_python_inc_missing_config_dir(self, monkeypatch):
303+
"""
304+
In portable Python installations, the sysconfig will be broken,
305+
pointing to the directories where the installation was built and
306+
not where it currently is. In this case, ensure that the missing
307+
directory isn't used for get_python_inc.
308+
309+
See pypa/distutils#178.
310+
"""
311+
312+
def override(name):
313+
if name == 'INCLUDEPY':
314+
return '/does-not-exist'
315+
return sysconfig.get_config_var(name)
316+
317+
monkeypatch.setattr(sysconfig, 'get_config_var', override)
318+
319+
assert os.path.exists(sysconfig.get_python_inc())

0 commit comments

Comments
 (0)