GithubHelp home page GithubHelp logo

pytest-html-example's Introduction

pytest + pytest-html

Test repository for StackOverflow question PyTest: Interactive Output (instead of pure ASCII).

$ pip install -r requirements.txt
$ pytest --showlocals --html=report.html --self-contained-html testmodule/test.py
=================================== test session starts ====================================
platform linux -- Python 3.9.1, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/test
plugins: html-3.1.1, metadata-1.11.0
collected 2 items

testmodule/test.py F.                                                                [100%]

========================================= FAILURES =========================================
_________________________________________ test_add _________________________________________

    def test_add():
        foo = 10
        bar = 12
>       assert add(foo, bar) == 22
E       assert -2 == 22
E        +  where -2 = add(10, 12)

bar        = 12
foo        = 10

testmodule/test.py:12: AssertionError
-------------------- generated html file: file:///tmp/test/report.html ---------------------
================================= short test summary info ==================================
FAILED testmodule/test.py::test_add - assert -2 == 22
=============================== 1 failed, 1 passed in 0.02s ================================

This will generate a report.html for you.

HTML report example

pytest-html-example's People

Contributors

buzz avatar

Watchers

 avatar  avatar

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.