[Python-checkins] r43425 - sandbox/trunk/setuptools/setuptools/command/test.py

phillip.eby python-checkins at python.org
Wed Mar 29 23:09:44 CEST 2006


Author: phillip.eby
Date: Wed Mar 29 23:09:43 2006
New Revision: 43425

Modified:
   sandbox/trunk/setuptools/setuptools/command/test.py
Log:
Fix a problem with the test loader finding the bundled doctest's 
TestCase subclasses and trying to run them, too.


Modified: sandbox/trunk/setuptools/setuptools/command/test.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/test.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/test.py	Wed Mar 29 23:09:43 2006
@@ -13,8 +13,9 @@
         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 @@
                         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"""


More information about the Python-checkins mailing list