aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorAlexander Duryagin <aduryagin@gmail.com>2018-06-27 21:32:11 +0300
committerAlexander Duryagin <aduryagin@gmail.com>2018-06-27 21:32:11 +0300
commit776096522af8d8320b879571ded2b1c43242c0da (patch)
treeb50227696ed5fc7b28c2c5e449eab7639742972f /setuptools/tests
parent5c816483500519a07a3db4364daaced379780eb7 (diff)
downloadexternal_python_setuptools-776096522af8d8320b879571ded2b1c43242c0da.tar.gz
external_python_setuptools-776096522af8d8320b879571ded2b1c43242c0da.tar.bz2
external_python_setuptools-776096522af8d8320b879571ded2b1c43242c0da.zip
always process module.__path__ for namespace packages, fixes #1321
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_namespaces.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/setuptools/tests/test_namespaces.py b/setuptools/tests/test_namespaces.py
index 1ac1b35e..00ec75b4 100644
--- a/setuptools/tests/test_namespaces.py
+++ b/setuptools/tests/test_namespaces.py
@@ -109,3 +109,34 @@ class TestNamespaces:
]
with test.test.paths_on_pythonpath([str(target)]):
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_A))
+
+ @pytest.mark.skipif(bool(os.environ.get("APPVEYOR")),
+ reason="https://github.com/pypa/setuptools/issues/851")
+ def test_packages_in_the_sampe_namespace_installed_and_cwd(self, tmpdir):
+ """
+ Installing one namespace package and also have another in the same
+ namespace in the current working directory, both of them must be
+ importable.
+ """
+ pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
+ pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
+ target = tmpdir / 'packages'
+ # use pip to install to the target directory
+ install_cmd = [
+ sys.executable,
+ '-m',
+ 'pip.__main__',
+ 'install',
+ str(pkg_A),
+ '-t', str(target),
+ ]
+ subprocess.check_call(install_cmd)
+ namespaces.make_site_dir(target)
+
+ # ensure that all packages import and pkg_resources imports
+ pkg_resources_imp = [
+ sys.executable,
+ '-c', 'import pkg_resources; import myns.pkgA; import myns.pkgB',
+ ]
+ with test.test.paths_on_pythonpath([str(target)]):
+ subprocess.check_call(pkg_resources_imp, cwd=str(pkg_B))