From 387073fb4eab8f6680fa4382ed008d86103cf132 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 5 Jan 2022 23:17:45 -0500 Subject: [PATCH] Add test capturing failure. Ref #3002. --- setuptools/tests/test_distutils_adoption.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setuptools/tests/test_distutils_adoption.py b/setuptools/tests/test_distutils_adoption.py index 27759b1df8..ced41d2978 100644 --- a/setuptools/tests/test_distutils_adoption.py +++ b/setuptools/tests/test_distutils_adoption.py @@ -89,3 +89,13 @@ def test_distutils_local(venv): env = dict(SETUPTOOLS_USE_DISTUTILS='local') assert venv.name in find_distutils(venv, env=env).split(os.sep) assert count_meta_path(venv, env=env) <= 1 + + +def test_pip_import(venv): + """ + Ensure pip can be imported with the hack installed. + Regression test for #3002. + """ + env = dict(SETUPTOOLS_USE_DISTUTILS='local') + cmd = ['python', '-c', 'import pip'] + popen_text(venv.run)(cmd, env=env)