From 281fa7d067f8cfcf7a1a5203f03091c25c976a42 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Wed, 29 Mar 2006 21:09:43 +0000 Subject: Fix a problem with the test loader finding the bundled doctest's TestCase subclasses and trying to run them, too. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043425 --- setuptools/command/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setuptools/command') diff --git a/setuptools/command/test.py b/setuptools/command/test.py index 30226866..0370e372 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -13,8 +13,9 @@ class ScanningLoader(TestLoader): If the module has an ``additional_tests`` function, call it and add the return value to the tests. """ - - tests = [TestLoader.loadTestsFromModule(self,module)] + tests = [] + if module.__name__!='setuptools.tests.doctest': # ugh + tests.append(TestLoader.loadTestsFromModule(self,module)) if hasattr(module, "additional_tests"): tests.append(module.additional_tests()) @@ -32,13 +33,12 @@ class ScanningLoader(TestLoader): continue tests.append(self.loadTestsFromName(submodule)) - if len(tests)>1: + if len(tests)!=1: return self.suiteClass(tests) else: return tests[0] # don't create a nested suite for only one return - class test(Command): """Command to run unit tests after in-place build""" -- cgit v1.2.1