aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r--setuptools/command/test.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index e377a781..7422b719 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -1,10 +1,15 @@
+import unittest
+from unittest import TestLoader
+
from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import (resource_listdir, resource_exists,
normalize_path, working_set, _namespace_packages, add_activation_listener,
require, EntryPoint)
-from unittest import TestLoader
+
+from setuptools.py31compat import unittest_main
+
class ScanningLoader(TestLoader):
@@ -141,8 +146,6 @@ class test(Command):
self.with_project_on_sys_path(self.run_tests)
def run_tests(self):
- import unittest
-
# 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.
@@ -158,7 +161,7 @@ class test(Command):
del_modules.append(name)
list(map(sys.modules.__delitem__, del_modules))
- unittest.main(
+ unittest_main(
None, None, [unittest.__file__]+self.test_args,
testLoader=self._resolve_as_ep(self.test_loader),
testRunner=self._resolve_as_ep(self.test_runner),