diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-03-20 21:19:49 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-03-20 21:19:49 -0400 |
| commit | b4d8e4755eafc786a9848333ca73bff381747745 (patch) | |
| tree | 2b28c72a4df0dba750963bb3628683132cb50100 /setuptools/tests/test_develop.py | |
| parent | 8230bbf82b07d25bcc65e612e0e936dce269e463 (diff) | |
| download | python-setuptools-git-b4d8e4755eafc786a9848333ca73bff381747745.tar.gz | |
Add test capturing missed expectation. Ref #2612.
Diffstat (limited to 'setuptools/tests/test_develop.py')
| -rw-r--r-- | setuptools/tests/test_develop.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py index 2766da2f..e793c36d 100644 --- a/setuptools/tests/test_develop.py +++ b/setuptools/tests/test_develop.py @@ -7,6 +7,7 @@ import sys import io import subprocess import platform +import pathlib from setuptools.command import test @@ -199,3 +200,32 @@ class TestNamespaces: ] with test.test.paths_on_pythonpath([str(target)]): subprocess.check_call(pkg_resources_imp) + + @pytest.mark.xfail(reason="#2612") + def test_editable_prefix(self, tmp_path, sample_project): + """ + Editable install to a prefix should be discoverable. + """ + prefix = tmp_path / 'prefix' + prefix.mkdir() + + cmd = [ + sys.executable, + '-m', 'pip', + 'install', + '-e', str(sample_project), + '--prefix', str(prefix), + ] + subprocess.check_call(cmd) + + # now run 'sample' with the prefix on the PYTHONPATH + site_packages = prefix / next( + pathlib.Path(path).relative_to(sys.prefix) + for path in sys.path + if 'site-packages' in path + and path.startswith(sys.prefix) + ) + env = dict(PYTHONPATH=site_packages) + bin = 'Scripts' if platform.system() == 'Windows' else 'bin' + sample = prefix / bin / 'sample' + subprocess.check_call([sample], env=env) |
