diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 18:38:36 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 18:38:36 -0500 |
commit | 16ee10c47583a4a2b7480af6fc5a205343acfdfd (patch) | |
tree | 7cfbb6d488a92fa01ddb86d6f226f549ad26a01e /tests/test_pkg_resources.py | |
parent | 866ff739f6e64aaaefcf7816263410527c9f55f7 (diff) | |
parent | 41f2c5ec8dd669747f3cfd8d6b2ae9a40d219545 (diff) | |
download | external_python_setuptools-16ee10c47583a4a2b7480af6fc5a205343acfdfd.tar.gz external_python_setuptools-16ee10c47583a4a2b7480af6fc5a205343acfdfd.tar.bz2 external_python_setuptools-16ee10c47583a4a2b7480af6fc5a205343acfdfd.zip |
Merge with 10.2.1
--HG--
branch : feature/issue-229
Diffstat (limited to 'tests/test_pkg_resources.py')
-rw-r--r-- | tests/test_pkg_resources.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_pkg_resources.py b/tests/test_pkg_resources.py index 11edfe85..564d7cec 100644 --- a/tests/test_pkg_resources.py +++ b/tests/test_pkg_resources.py @@ -4,6 +4,7 @@ import os import zipfile import datetime import time +import subprocess import pkg_resources @@ -89,3 +90,22 @@ class TestResourceManager(object): type_ = str(type(path)) message = "Unexpected type from get_cache_path: " + type_ assert isinstance(path, (unicode, str)), message + + +class TestIndependence: + """ + Tests to ensure that pkg_resources runs independently from setuptools. + """ + def test_setuptools_not_imported(self): + """ + In a separate Python environment, import pkg_resources and assert + that action doesn't cause setuptools to be imported. + """ + lines = ( + 'import pkg_resources', + 'import sys', + 'assert "setuptools" not in sys.modules, ' + '"setuptools was imported"', + ) + cmd = [sys.executable, '-c', '; '.join(lines)] + subprocess.check_call(cmd) |