diff options
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r-- | setuptools/tests/test_easy_install.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 24436d70..a90ae23f 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -9,6 +9,7 @@ import site import contextlib import textwrap import tarfile +import logging import distutils.core from setuptools.compat import StringIO, BytesIO, next, urlparse @@ -21,17 +22,6 @@ from setuptools.dist import Distribution from pkg_resources import Distribution as PRDistribution import setuptools.tests.server -try: - # import multiprocessing solely for the purpose of testing its existence - __import__('multiprocessing') - import logging - _LOG = logging.getLogger('test_easy_install') - logging.basicConfig(level=logging.INFO, stream=sys.stderr) - _MULTIPROC = True -except ImportError: - _MULTIPROC = False - _LOG = None - class FakeDist(object): def get_entry_map(self, group): if group != 'console_scripts': @@ -171,9 +161,15 @@ class TestUserInstallTest(unittest.TestCase): self.assertTrue(cmd.user, 'user should be implied') def test_multiproc_atexit(self): - if not _MULTIPROC: + try: + __import__('multiprocessing') + except ImportError: + # skip the test if multiprocessing is not available return - _LOG.info('this should not break') + + log = logging.getLogger('test_easy_install') + logging.basicConfig(level=logging.INFO, stream=sys.stderr) + log.info('this should not break') def test_user_install_not_implied_without_usersite_enabled(self): site.ENABLE_USER_SITE = False # usually enabled |