aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/test.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-11-13 10:03:08 -0500
committerGitHub <noreply@github.com>2017-11-13 10:03:08 -0500
commitc243d47e668be99bfc0da37aba6c8e6fafb14f9e (patch)
treedaaa4f70aa5ad38beaea926741e0de0a0c64ae05 /setuptools/command/test.py
parentc218b65053915aa084c897defa2a25a11175ddc4 (diff)
parentdb54a7089071a65d5cca11c33f68376280580b7f (diff)
downloadexternal_python_setuptools-c243d47e668be99bfc0da37aba6c8e6fafb14f9e.tar.gz
external_python_setuptools-c243d47e668be99bfc0da37aba6c8e6fafb14f9e.tar.bz2
external_python_setuptools-c243d47e668be99bfc0da37aba6c8e6fafb14f9e.zip
Merge pull request #1187 from benoit-pierre/fix_test_command
Fix test command
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r--setuptools/command/test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index 638d0c56..bfa71496 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -18,6 +18,11 @@ from setuptools.py31compat import unittest_main
class ScanningLoader(TestLoader):
+
+ def __init__(self):
+ TestLoader.__init__(self)
+ self._visited = set()
+
def loadTestsFromModule(self, module, pattern=None):
"""Return a suite of all tests cases contained in the given module
@@ -25,6 +30,10 @@ class ScanningLoader(TestLoader):
If the module has an ``additional_tests`` function, call it and add
the return value to the tests.
"""
+ if module in self._visited:
+ return None
+ self._visited.add(module)
+
tests = []
tests.append(TestLoader.loadTestsFromModule(self, module))
@@ -101,6 +110,8 @@ class test(Command):
return list(self._test_args())
def _test_args(self):
+ if not self.test_suite and sys.version_info >= (2, 7):
+ yield 'discover'
if self.verbose:
yield '--verbose'
if self.test_suite: