[pywin32-checkins] pywin32/com/win32com/test testall.py,1.14,1.15
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-10-23 15:19:41
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv28934 Modified Files: testall.py Log Message: Add support for unittest tests. Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** testall.py 3 Jul 2003 03:45:48 -0000 1.14 --- testall.py 23 Oct 2003 07:10:02 -0000 1.15 *************** *** 38,45 **** print "***** %s test FAILED after %d lines of output" % (desc, capture.get_num_lines_captured()) if __name__=='__main__': # default to "quick" test. 2==medium, 3==full testLevel = 1 - try: if len(sys.argv)>1: --- 38,46 ---- print "***** %s test FAILED after %d lines of output" % (desc, capture.get_num_lines_captured()) + unittest_modules = "testIterators".split() + if __name__=='__main__': # default to "quick" test. 2==medium, 3==full testLevel = 1 try: if len(sys.argv)>1: *************** *** 50,53 **** --- 51,66 ---- CleanGenerated() + import unittest + testRunner = unittest.TextTestRunner(verbosity=1) + for mod_name in unittest_modules: + mod = __import__(mod_name) + if hasattr(mod, "suite"): + test = mod.suite() + else: + test = unittest.defaultTestLoader.loadTestsFromModule(mod) + result = testRunner.run(test) + if not result.wasSuccessful(): + print "*" * 50 + print "Unittest tests failed" import win32com.test.util capture = win32com.test.util.CaptureWriter() |