Coder Social home page Coder Social logo

tungwaiyip / htmltestrunner Goto Github PK

View Code? Open in Web Editor NEW
97.0 97.0 332.0 447 KB

HTMLTestRunner is an extension to the Python standard library's unittest module. It generates easy to use HTML test reports.

Home Page: http://tungwaiyip.info/software/sample_test_report.html

Python 100.00%

htmltestrunner's People

Contributors

tungwaiyip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

htmltestrunner's Issues

why was the file where I want to write a test_report into alway closed

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

expand collapse button for traceback in error log window

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?

Detail output overlap

-----case1
pt2.1: test_sub1..
test_sub2..
test_sub3..
test_sub1..

-----case2
pt3.1: test_sub1..
test_sub2..
test_sub3..
test_sub1..
test_sub1

-----case3
pt3.2: test_sub1..
test_sub2..
test_sub3..
test_sub1..
test_sub1

test_sub3

It does not work with Python 3

Hi,

I tried it with Python 3.x but it does not work.
Could you please make it Python 3 compatible?

It would be really helpful.
I really appreciate your help.

Thanks

'No module named 'HTMLTestRunner'

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.

Is it Python 3.2 Compatible ?

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 ?

Thanks!
Noam.

HTMLTestRunner.py has a bug

@tungwaiyip

  • HTMLTestRunner for Version 0.8.3 has a Bug, follow code:

    TestResult = unittest.TestResult
    
    class _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 = None
            self.stderr0 = None
            self.success_count = 0
            self.failure_count = 0
            self.error_count = 0
            self.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 = []
            
        def startTest(self, test):
            TestResult.startTest(self, test)
            # just one buffer for both stdout and stderr
            stdout_redirector.fp = self.outputBuffer
            stderr_redirector.fp = self.outputBuffer
            self.stdout0 = sys.stdout
            self.stderr0 = sys.stderr
            sys.stdout = stdout_redirector
            sys.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:

image

  • Modify this bug, follow me

    move code self.outputBuffer = StringIO.StringIO() to

        def startTest(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.outputBuffer
            stderr_redirector.fp = self.outputBuffer
            self.stdout0 = sys.stdout
            self.stderr0 = sys.stderr
            sys.stdout = stdout_redirector
            sys.stderr = stderr_redirector

HTMLTestRunner runs more than once

Hi Sir,

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.

Thank you. Hope to hear from you. :)

Storing HtmlTestRunner reports in Web Server

Hi,
Can you recommend of a good way to store HtmlTestRunner reports in a Web Server with Database ?

Can I use Django for that purpose, so that the unit test results be stored in database, and Django will use HtmlTestRunner Template ?

Thanks!

HTML报告中新增一列,存放错误截图

可否在HTML报告中增加一列,用以存放用例断言失败时的截图(通过get_screenshot_as_file这个方法截取的存放在本地指定路径下的图片)。断言成功无截图则相应的用例后面的截图一列不添加附件;断言失败有错误截图,则将截图作为附件插入到HTML报告中对应的用例后面。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.