[Python-checkins] python/dist/src/Lib/test test_support.py,1.56,1.57

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Tue, 15 Jul 2003 19:59:34 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv31277

Modified Files:
	test_support.py 
Log Message:
run_unittest() to support TestCase instances as well as classes.  Helps with doctests.

Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** test_support.py	17 May 2003 01:59:57 -0000	1.56
--- test_support.py	16 Jul 2003 02:59:32 -0000	1.57
***************
*** 252,256 ****
      suite = unittest.TestSuite()
      for cls in classes:
!         suite.addTest(unittest.makeSuite(cls))
      if len(classes)==1:
          testclass = classes[0]
--- 252,259 ----
      suite = unittest.TestSuite()
      for cls in classes:
!         if isinstance(cls, unittest.TestCase):
!             suite.addTest(cls)
!         else:
!             suite.addTest(unittest.makeSuite(cls))
      if len(classes)==1:
          testclass = classes[0]