diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-11-19 21:39:41 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-11-19 21:39:41 -0500 |
commit | e4572e8c828cf5c82e072e01672283b5f27396a4 (patch) | |
tree | e8cc8df65484f1f29d9e6bd0a27a362eadddd068 /setuptools/command/test.py | |
parent | dcb24ad15465c266a3f258471766fbbe8fc8a42e (diff) | |
parent | d1cef0c5aa0ca473d4b5fef6b11e5508a37663a2 (diff) | |
download | external_python_setuptools-e4572e8c828cf5c82e072e01672283b5f27396a4.tar.gz external_python_setuptools-e4572e8c828cf5c82e072e01672283b5f27396a4.tar.bz2 external_python_setuptools-e4572e8c828cf5c82e072e01672283b5f27396a4.zip |
Merge branch 'master' into drop-py26
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r-- | setuptools/command/test.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index f00d6794..51aee1f7 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -18,6 +18,11 @@ from setuptools import Command 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: |