aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_namespaces.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-12 19:45:51 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-12 19:47:05 -0500
commit357b7c659b6893dec4145d492084217b9317bca1 (patch)
tree963eefe3a358f2bce1de2086b4147085d4f00486 /setuptools/tests/test_namespaces.py
parent8c055ff64792c23e80f85f4c127d003fd2ae4b7d (diff)
downloadexternal_python_setuptools-357b7c659b6893dec4145d492084217b9317bca1.tar.gz
external_python_setuptools-357b7c659b6893dec4145d492084217b9317bca1.tar.bz2
external_python_setuptools-357b7c659b6893dec4145d492084217b9317bca1.zip
Add test attempting to capture failure, but it passes. Ref #885.
Diffstat (limited to 'setuptools/tests/test_namespaces.py')
-rw-r--r--setuptools/tests/test_namespaces.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/setuptools/tests/test_namespaces.py b/setuptools/tests/test_namespaces.py
index e7fa4ee6..2aefb487 100644
--- a/setuptools/tests/test_namespaces.py
+++ b/setuptools/tests/test_namespaces.py
@@ -50,3 +50,26 @@ class TestNamespaces:
]
env = dict(PYTHONPATH=python_path)
subprocess.check_call(try_import, env=env)
+
+ def test_pkg_resources_import(self, tmpdir):
+ """
+ Ensure that a namespace package doesn't break on import
+ of pkg_resources.
+ """
+ pkg = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
+ target = tmpdir / 'packages'
+ target.mkdir()
+ env = dict(PYTHONPATH=str(target))
+ install_cmd = [
+ sys.executable,
+ '-m', 'easy_install',
+ '-d', str(target),
+ str(pkg),
+ ]
+ subprocess.check_call(install_cmd, env=env)
+ namespaces.make_site_dir(target)
+ try_import = [
+ sys.executable,
+ '-c', 'import pkg_resources',
+ ]
+ subprocess.check_call(try_import, env=env)