[Python-checkins] python/dist/src/Lib/test README,1.12,1.13

bwarsaw@sourceforge.net bwarsaw@sourceforge.net
2002年4月23日 14:39:10 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv416
Modified Files:
	README 
Log Message:
Rewrote the PyUnit description so that it now recommends to use
run_suite() instead of run_unittest(). Best practice is to plan for
multiple test classes.
Index: README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/README,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** README	28 Sep 2001 20:05:25 -0000	1.12
--- README	23 Apr 2002 21:39:00 -0000	1.13
***************
*** 41,47 ****
 run_unittest() takes a unittest.TestCase derived class as a parameter
 and runs the tests defined in that class, and run_suite() takes a
! populated TestSuite instance and runs the tests.. All test methods in
! the Python regression framework have names that start with "test_" and
! use lower-case names with words separated with underscores.
 
 All PyUnit-based tests in the Python test suite use boilerplate that
--- 41,51 ----
 run_unittest() takes a unittest.TestCase derived class as a parameter
 and runs the tests defined in that class, and run_suite() takes a
! populated TestSuite instance and runs the tests. run_suite() is
! preferred because unittest files typically grow multiple test classes,
! and you might as well be prepared.
! 
! All test methods in the Python regression framework have names that
! start with "test_" and use lower-case names with words separated with
! underscores.
 
 All PyUnit-based tests in the Python test suite use boilerplate that
***************
*** 51,59 ****
 import test_support
 
! class MyTestCase(unittest.TestCase):
 # define test methods here...
 
 def test_main():
! test_support.run_unittest(MyTestCase)
 
 if __name__ == "__main__":
--- 55,69 ----
 import test_support
 
! class MyTestCase1(unittest.TestCase):
 # define test methods here...
 
+ class MyTestCase2(unittest.TestCase):
+ # define more test methods here...
+ 
 def test_main():
! 	suite = unittest.TestSuite()
! 	suite.addTest(unittest.makeSuite(MyTestCase1))
! 	suite.addTest(unittest.makeSuite(MyTestCase2))
! test_support.run_suite(suite)
 
 if __name__ == "__main__":
***************
*** 154,158 ****
 make test
 
! {WINDOWS] Run rt.bat from your PCBuild directory. Read the comments at
 the top of rt.bat for the use of special -d, -O and -q options processed
 by rt.bat.
--- 164,168 ----
 make test
 
! [WINDOWS] Run rt.bat from your PCBuild directory. Read the comments at
 the top of rt.bat for the use of special -d, -O and -q options processed
 by rt.bat.

AltStyle によって変換されたページ (->オリジナル) /