diff options
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r-- | setuptools/command/test.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index 7422b719..3c3581a9 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -8,6 +8,7 @@ from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint) +from setuptools.compat import PY3 from setuptools.py31compat import unittest_main @@ -87,10 +88,8 @@ class test(Command): self.test_runner = getattr(self.distribution, 'test_runner', None) def with_project_on_sys_path(self, func): - with_2to3 = ( - sys.version_info >= (3,) - and getattr(self.distribution, 'use_2to3', False) - ) + with_2to3 = PY3 and getattr(self.distribution, 'use_2to3', False) + if with_2to3: # If we run 2to3 we can not do this inplace: @@ -149,7 +148,7 @@ class test(Command): # Purge modules under test from sys.modules. The test loader will # re-import them from the build location. Required when 2to3 is used # with namespace packages. - if sys.version_info >= (3,) and getattr(self.distribution, 'use_2to3', False): + if PY3 and getattr(self.distribution, 'use_2to3', False): module = self.test_args[-1].split('.')[0] if module in _namespace_packages: del_modules = [] |