@@ -40,21 +40,31 @@ The test_support helper module provides a two functions for use by
4040PyUnit based tests in the Python regression testing framework:
4141run_unittest() takes a unittest.TestCase derived class as a parameter
4242and runs the tests defined in that class, and run_suite() takes a
43- populated TestSuite instance and runs the tests.. All test methods in
44- the Python regression framework have names that start with "test_" and
45- use lower-case names with words separated with underscores.
43+ populated TestSuite instance and runs the tests. run_suite() is
44+ preferred because unittest files typically grow multiple test classes,
45+ and you might as well be prepared.
46+
47+ All test methods in the Python regression framework have names that
48+ start with "test_" and use lower-case names with words separated with
49+ underscores.
4650
4751All PyUnit-based tests in the Python test suite use boilerplate that
4852looks like this:
4953
5054 import unittest
5155 import test_support
5256
53- class MyTestCase (unittest.TestCase):
57+ class MyTestCase1 (unittest.TestCase):
5458 # define test methods here...
5559
60+ class MyTestCase2(unittest.TestCase):
61+ # define more test methods here...
62+
5663 def test_main():
57- test_support.run_unittest(MyTestCase)
64+ suite = unittest.TestSuite()
65+ suite.addTest(unittest.makeSuite(MyTestCase1))
66+ suite.addTest(unittest.makeSuite(MyTestCase2))
67+ test_support.run_suite(suite)
5868
5969 if __name__ == "__main__":
6070 test_main()
@@ -153,7 +163,7 @@ top level:
153163
154164 make test
155165
156- { WINDOWS] Run rt.bat from your PCBuild directory. Read the comments at
166+ [ WINDOWS] Run rt.bat from your PCBuild directory. Read the comments at
157167the top of rt.bat for the use of special -d, -O and -q options processed
158168by rt.bat.
159169
0 commit comments