You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTMLTestRunner for Version 0.8.3 has a Bug, follow code:
TestResult=unittest.TestResultclass_TestResult(TestResult):
# note: _TestResult is a pure representation of results.# It lacks the output and reporting ability compares to unittest._TextTestResult.def__init__(self, verbosity=1):
TestResult.__init__(self)
'''this line start'''self.outputBuffer=StringIO.StringIO()
'''this line end'''self.stdout0=Noneself.stderr0=Noneself.success_count=0self.failure_count=0self.error_count=0self.verbosity=verbosity# result is a list of result in 4 tuple# (# result code (0: success; 1: fail; 2: error),# TestCase object,# Test output (byte string),# stack trace,# )self.result= []
defstartTest(self, test):
TestResult.startTest(self, test)
# just one buffer for both stdout and stderrstdout_redirector.fp=self.outputBufferstderr_redirector.fp=self.outputBufferself.stdout0=sys.stdoutself.stderr0=sys.stderrsys.stdout=stdout_redirectorsys.stderr=stderr_redirector
this block code will create a report.html after testsuite end, but in the report.html's popup_window will rewrite outputbuffer. example:
Modify this bug, follow me
move code self.outputBuffer = StringIO.StringIO() to
defstartTest(self, test):
TestResult.startTest(self, test)
# just one buffer for both stdout and stderr'''after modify start'''self.outputBuffer=StringIO.StringIO()
'''after modify end'''stdout_redirector.fp=self.outputBufferstderr_redirector.fp=self.outputBufferself.stdout0=sys.stdoutself.stderr0=sys.stderrsys.stdout=stdout_redirectorsys.stderr=stderr_redirector
The text was updated successfully, but these errors were encountered:
@tungwaiyip
HTMLTestRunner for Version 0.8.3 has a Bug, follow code:
this block code will create a
report.html
after testsuite end, but in the report.html'spopup_window
will rewrite outputbuffer. example:Modify this bug, follow me
move code
self.outputBuffer = StringIO.StringIO()
toThe text was updated successfully, but these errors were encountered: