I just would like to ask, when I used HTMLTestRunner.py in my code, it ran twice or more. Can I make it run only once? Because there are testing I need to do regarding adding a profile or member. So when it run the second time, it will error on the second run since the record already exist.
Hi guys, I meet HTMLTestRunner when I was studying about unittest and think it's a useful library to expand my tests.
So, I'm trying to execute some test suites and I'm receiving this error:
from HTMLTestRunner import HTMLTestRunner
ModuleNotFoundError: No module named 'HTMLTestRunner'
I've downloaded the project from git and extracted the files in my project directory but don't work.
My suite are okay, cause I was executing them just using nose and unittest but when I include this library they stop work :/
I've read some issues here but they don't help to much. I'm using Python 3.6 and my SO is Windows 7 64bits.
Hello Wai Yip,
I'm using your module and it's working great!!
Recently I was trying to use an earlier version of HTMLTestRunner in Python 3.2, but it could not run. Is the new version (0.8.2) compatible for Python 3.2 ?
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
I am working on a custom implementation of htmltestrunner for internal usage. This is a part that seems unessary since i get my errors and failure stacktraces from my failure list so why bother redirecting these.
I am using your html runner for generating report.
But from user there is one request that in fail case the traceback should be expandable.
Meaning, if we want to see traceback then there should be button (say named traceback) which will expand to see the detail.
We need this because traceback in log make log very messy.
Please tell me how to achieve this or what all changes i need to do in HTMLRunner.py?
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 232, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 88, in run
self._target(*self._args, **self._kwargs)
File "C:\Python27\lib\HTMLTestRunner.py", line 630, in run
self.generateReport(test, result)
File "C:\Python27\lib\HTMLTestRunner.py", line 687, in generateReport
self.stream.write(output.encode('utf8'))
ValueError: I/O operation on closed file