From 357b7c659b6893dec4145d492084217b9317bca1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 12 Dec 2016 19:45:51 -0500 Subject: Add test attempting to capture failure, but it passes. Ref #885. --- setuptools/tests/test_namespaces.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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) -- cgit v1.2.3