[Python-checkins] python/dist/src/Lib/test test_bisect.py,1.7,1.8 test_bool.py,1.9,1.10 test_os.py,1.15,1.16 test_support.py,1.50,1.51
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Sun, 27 Apr 2003 00:54:26 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv17451
Modified Files:
test_bisect.py test_bool.py test_os.py test_support.py
Log Message:
Factor out common boilerplate for test_support
Index: test_bisect.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bisect.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** test_bisect.py 19 Feb 2003 02:35:05 -0000 1.7
--- test_bisect.py 27 Apr 2003 07:54:23 -0000 1.8
***************
*** 193,206 ****
"""
- #==============================================================================
-
- def makeAllTests():
- suite = unittest.TestSuite()
- for klass in (TestBisect,
- TestInsort
- ):
- suite.addTest(unittest.makeSuite(klass))
- return suite
-
#------------------------------------------------------------------------------
--- 193,196 ----
***************
*** 209,214 ****
def test_main(verbose=None):
from test import test_bisect
! suite = makeAllTests()
! test_support.run_suite(suite)
test_support.run_doctest(test_bisect, verbose)
--- 199,204 ----
def test_main(verbose=None):
from test import test_bisect
! test_support.run_classtests(TestBisect,
! TestInsort)
test_support.run_doctest(test_bisect, verbose)
Index: test_bool.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bool.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_bool.py 25 Apr 2003 10:22:01 -0000 1.9
--- test_bool.py 27 Apr 2003 07:54:23 -0000 1.10
***************
*** 332,338 ****
def test_main():
! suite = unittest.TestSuite()
! suite.addTest(unittest.makeSuite(BoolTest))
! test_support.run_suite(suite)
if __name__ == "__main__":
--- 332,336 ----
def test_main():
! test_support.run_classtests(BoolTest)
if __name__ == "__main__":
Index: test_os.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_os.py 25 Apr 2003 07:11:48 -0000 1.15
--- test_os.py 27 Apr 2003 07:54:23 -0000 1.16
***************
*** 10,14 ****
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__)
! from test.test_support import TESTFN, run_suite
class TemporaryFileTests(unittest.TestCase):
--- 10,14 ----
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__)
! from test.test_support import TESTFN, run_classtests
class TemporaryFileTests(unittest.TestCase):
***************
*** 283,294 ****
def test_main():
! suite = unittest.TestSuite()
! for cls in (TemporaryFileTests,
! StatAttributeTests,
! EnvironTests,
! WalkTests,
! ):
! suite.addTest(unittest.makeSuite(cls))
! run_suite(suite)
if __name__ == "__main__":
--- 283,290 ----
def test_main():
! run_classtests(TemporaryFileTests,
! StatAttributeTests,
! EnvironTests,
! WalkTests)
if __name__ == "__main__":
Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** test_support.py 24 Apr 2003 19:06:57 -0000 1.50
--- test_support.py 27 Apr 2003 07:54:23 -0000 1.51
***************
*** 234,237 ****
--- 234,243 ----
run_suite(unittest.makeSuite(testclass), testclass)
+ def run_classtests(*classnames):
+ suite = unittest.TestSuite()
+ for cls in classnames:
+ suite.addTest(unittest.makeSuite(cls))
+ run_suite(suite)
+
#=======================================================================