Skip to main content

A pytest plugin to make a test results report with Markdown table format.

Project description

Summary

PyPI package version Supported Python versions Supported Python implementations Linux/macOS CI status Windows CI status

A pytest plugin to make a test results report with Markdown table format.

Installation

pip install pytest-md-report

Usage

$ pytest --md-report examples/
https://github.com/thombashi/pytest-md-report/blob/master/ss/pytest_md_report_example.png

Output example

Other examples

Increase verbosity level (--md-report-verbose option):

$ pytest --md-report --md-report-verbose=1 examples/
https://github.com/thombashi/pytest-md-report/blob/master/ss/pytest_md_report_example_verbose.png

Output example (verbose)

Not rendering results of zero value (--md-report-zeros emmpty option):

$ pytest --md-report --md-report-zeros empty --md-report-color never examples/
|         filepath         | passed | failed | error | skipped | xfailed | xpassed |
|--------------------------|-------:|-------:|------:|--------:|--------:|--------:|
| examples/test_error.py   |        |        |     2 |         |         |         |
| examples/test_failed.py  |        |      2 |       |         |         |         |
| examples/test_pass.py    |      2 |        |       |         |         |         |
| examples/test_skipped.py |        |        |       |       2 |         |         |
| examples/test_xfailed.py |        |        |       |         |       2 |         |
| examples/test_xpassed.py |        |        |       |         |         |       2 |
| TOTAL                    |      2 |      2 |     2 |       2 |       2 |       2 |

Options

Command options

make test results report with markdown table format:
  --md-report           create markdown report. you can also specify the value
                        with PYTEST_MD_REPORT environment variable.
  --md-report-verbose=VERBOSITY_LEVEL
                        verbosity level for pytest-md-report. if not set, using
                        verbosity level of pytest. defaults to 0. you can also
                        specify the value with PYTEST_MD_REPORT_VERBOSE
                        environment variable.
  --md-report-color={auto,text,never}
                        auto: display colored (text and background) reports by
                        using ANSI escape codes. text: display colored (text)
                        reports by using ANSI escape codes. never: display
                        report without color. defaults to 'auto'. you can also
                        specify the value with PYTEST_MD_REPORT_COLOR
                        environment variable.
  --md-report-margin=MARGIN
                        margin size for each cells. defaults to 1. you can also
                        specify the value with PYTEST_MD_REPORT_MARGIN
                        environment variable.
  --md-report-zeros={number,empty}
                        rendering method for results of zero values. number:
                        render as a digit number (0). empty: not rendering.
                        defaults to number. you can also specify the value with
                        PYTEST_MD_REPORT_ZEROS environment variable.

ini-options

[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found:

md_report (bool):     create markdown report.
md_report_verbose (string):
                      verbosity level for pytest-md-report. if not set, using
                      verbosity level of pytest. defaults to 0.
md_report_color (string):
                      auto: display colored (text and background) reports by
                      using ANSI escape codes. text: display colored (text)
                      reports by using ANSI escape codes. never: display
                      report without color. defaults to 'auto'.
md_report_margin (string):
                      margin size for each cells. defaults to 1.
md_report_zeros (string):
                      rendering method for results of zero values. number:
                      render as a digit number (0). empty: not rendering.
                      defaults to number.

Example of setup.cfg:

[tool:pytest]
md_report = True
md_report_verbose = 0
md_report_color = auto

Dependencies

Python 3.5+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-md-report-0.0.6.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

pytest_md_report-0.0.6-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page