Skip to main content

pytest plugin for pytest-repeat that aggregates test result of the same test in terminal and html(if pytest-html is available) with additional statistics.

Project description

pytest-aggreport

PyPI version Python versions See Build Status on Travis CI

This pytest plugin was generated with Cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template.

Features

  • Generate aggregated test result group by test case name with details;
  • Embed test result into html report if pytest-html is available;

Requirements

  • python >= 3.6
  • pytest >= 4.3.1
  • beautifultable >= 0.7.0
  • pytest-repeat >= 0.8.0

Installation

You can install "pytest-aggreport" via pip from PyPI:

$ pip install pytest-aggreport

Usage

Pytest will automatically find the plugin and use it when you run pytest with --count argument (enable pytest-repeat plugin). When test is done, you will see a summary report in the terminal:

$ pytest --count=5
...
------------------------- aggregate summary report -----------------
+-------------+------+------+-------+--------+-------+-------+-------+---------+
| TestCase Na | Pass | Fail | Skipp | Pass R | AVG ( | MAX ( | MIN ( | STDDEV  |
|     me      |  ed  |  ed  |  ed   |  ate   |  s)   |  s)   |  s)   |   (s)   |
+-------------+------+------+-------+--------+-------+-------+-------+---------+
|  test_pass  |  5   |  0   |   0   | 100.00 |  0.1  |  0.1  |  0.1  |   0.0   |
|             |      |      |       |   %    |       |       |       |         |
+-------------+------+------+-------+--------+-------+-------+-------+---------+
|  test_skip  |  0   |  0   |   5   | 0.00%  |  0.0  |  0.0  |  0.0  |   0.0   |
+-------------+------+------+-------+--------+-------+-------+-------+---------+
|  test_fail  |  0   |  5   |   0   | 0.00%  | 0.15  | 0.15  | 0.15  |   0.0   |
+-------------+------+------+-------+--------+-------+-------+-------+---------+
| test_xpass  |  5   |  0   |   0   | 100.00 |  0.1  |  0.1  |  0.1  |   0.0   |
|             |      |      |       |   %    |       |       |       |         |
+-------------+------+------+-------+--------+-------+-------+-------+---------+
| test_xfail  |  0   |  5   |   0   | 0.00%  |  0.1  |  0.1  |  0.1  |   0.0   |
+-------------+------+------+-------+--------+-------+-------+-------+---------+
...

If pytest-html is enabled(run with --html argument), then a summary report will also be embedded in the html report:

html_report

To disable the plugin, you can use the -p argument, for example:

$ pytest -p no:aggreport

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "pytest-aggreport" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

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-aggreport-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

pytest_aggreport-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest-aggreport-0.1.1.tar.gz.

File metadata

  • Download URL: pytest-aggreport-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4

File hashes

Hashes for pytest-aggreport-0.1.1.tar.gz
Algorithm Hash digest
SHA256 795928ccf79076b7a4605434375f85da169c07e69c135a2d4ce62e2058e10da3
MD5 9e3b05e4c7272fd11df2b3f6c2e017d3
BLAKE2b-256 442e2719dd51be4fbac7fab7cd9a6deb465679199fdef4bd502e90ad9cc032d9

See more details on using hashes here.

File details

Details for the file pytest_aggreport-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_aggreport-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4

File hashes

Hashes for pytest_aggreport-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d31729bbd14bd85468584c8e96ace89646ecf2fad1a316ce704ee8deb2781d5
MD5 0e48a3c05e0c9c12e442d32e1dad970b
BLAKE2b-256 9404ea7cb474de7a327778e73592e8447aad30aa09c430d4ecc8c4929e5f3011

See more details on using hashes here.

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