Update of /cvsroot/proctor/Proctor/proctorlib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv793/proctorlib
Modified Files:
runner.py
Log Message:
Fix _exc_info_to_string() usage for Python 2.4 std library version
of unittest.py.
Add flush calls.
Index: runner.py
===================================================================
RCS file: /cvsroot/proctor/Proctor/proctorlib/runner.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** runner.py 16 Apr 2005 00:00:25 -0000 1.10
--- runner.py 17 Apr 2005 13:46:58 -0000 1.11
***************
*** 149,152 ****
--- 149,153 ----
)
print progress_line,
+ sys.stdout.flush()
self.num_tests_run += 1
***************
*** 228,237 ****
return list
! def _exc_info_to_string(self, err):
! """Converts a sys.exc_info()-style tuple of values into a string."""
! #err_class, err_inst, tb = err
! #formated_exception = self._format_list(traceback.extract_tb(tb, None))
! formated_exception = traceback.format_exception(*err)
! return ''.join(formated_exception)
def addError(self, test, err):
--- 229,238 ----
return list
! #def _exc_info_to_string(self, err):
! # """Converts a sys.exc_info()-style tuple of values into a string."""
! # #err_class, err_inst, tb = err
! # #formated_exception = self._format_list(traceback.extract_tb(tb, None))
! # formated_exception = traceback.format_exception(*err)
! # return ''.join(formated_exception)
def addError(self, test, err):
***************
*** 239,243 ****
#unittest.TestResult.addError(self, test, err)
print 'ERROR'
! print self._exc_info_to_string(err)
trace.outof()
return
--- 240,245 ----
#unittest.TestResult.addError(self, test, err)
print 'ERROR'
! print self._exc_info_to_string(err, test)
! sys.stdout.flush()
trace.outof()
return
***************
*** 247,252 ****
#unittest.TestResult.addFailure(self, test, err)
print 'FAIL'
! print self._exc_info_to_string(err)
print
trace.outof()
return
--- 249,255 ----
#unittest.TestResult.addFailure(self, test, err)
print 'FAIL'
! print self._exc_info_to_string(err, test)
print
+ sys.stdout.flush()
trace.outof()
return
***************
*** 257,260 ****
--- 260,264 ----
unittest.TestResult.addSuccess(self, test)
print 'ok'
+ sys.stdout.flush()
trace.outof()
***************
*** 284,287 ****
--- 288,292 ----
print '%s %s' % (self.PREFIX, message)
print
+ sys.stdout.flush()
return
***************
*** 292,295 ****
--- 297,301 ----
print test.id()
+ sys.stdout.flush()
self.num_tests_run += 1
***************
*** 310,313 ****
--- 316,320 ----
print progress_line
self._outputSeparator('End progress')
+ sys.stdout.flush()
return
***************
*** 319,331 ****
print 'ok'
self._outputSeparator('End results')
return
def addError(self, test, err):
unittest.TestResult.addError(self, test, err)
! print self._exc_info_to_string(err)
self._outputSeparator('Start results')
print 'ERROR'
self._outputSeparator('End results')
return
--- 326,340 ----
print 'ok'
self._outputSeparator('End results')
+ sys.stdout.flush()
return
def addError(self, test, err):
unittest.TestResult.addError(self, test, err)
! print self._exc_info_to_string(err, test)
self._outputSeparator('Start results')
print 'ERROR'
self._outputSeparator('End results')
+ sys.stdout.flush()
return
***************
*** 333,341 ****
unittest.TestResult.addFailure(self, test, err)
! print self._exc_info_to_string(err)
self._outputSeparator('Start results')
print 'FAIL'
self._outputSeparator('End results')
return
--- 342,351 ----
unittest.TestResult.addFailure(self, test, err)
! print self._exc_info_to_string(err, test)
self._outputSeparator('Start results')
print 'FAIL'
self._outputSeparator('End results')
+ sys.stdout.flush()
return
***************
*** 362,365 ****
--- 372,376 ----
self._outputSeparator('End summary')
+ sys.stdout.flush()
return
|