Skip to main content

Change the exit code of pytest test sessions when a required percent of tests pass.

Project description

Requirements:

Installation:

pip install pytest-percent

About:

This plugin will change the exit code of pytest test sessions when a required percent of tests pass.

Usage:

pytest --required-percent=80

=============================================================================================================================================== test session starts ===============================================================================================================================================
platform win32 -- Python 3.8.0, pytest-5.3.1, py-1.8.0, pluggy-0.13.0
rootdir: D:\Documents\pytest.percent, inifile: pytest.ini
plugins: metadata-1.8.0, percent-0.0.2
collected 5 items                                                                                                                                                                                                                                                                                                  

tests/test_percent.py::test_one PASSED                                                                                                                                                                                                                                                                       [ 20%]
tests/test_percent.py::test_two PASSED                                                                                                                                                                                                                                                                       [ 40%]
tests/test_percent.py::test_three PASSED                                                                                                                                                                                                                                                                     [ 60%]
tests/test_percent.py::test_four PASSED                                                                                                                                                                                                                                                                      [ 80%]
tests/test_percent.py::test_five FAILED                                                                                                                                                                                                                                                                      [100%]
--------------------------------------------------------------------------------------------------------------------------------------------- live log sessionfinish ----------------------------------------------------------------------------------------------------------------------------------------------
INFO     pytest_percent:pytest_percent.py:35 80% of tests passed, required 80%.


================================== FAILURES ===================================
__________________________________ test_five __________________________________

    def test_five():
>       assert False
E       assert False

tests\test_percent.py:18: AssertionError
========================= 1 failed, 4 passed in 0.10s =========================

D:\Documents\pytest.percent>echo %errorLevel%
0

Issues

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

License:

MIT License

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-percent-0.0.4.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_percent-0.0.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-percent-0.0.4.tar.gz.

File metadata

  • Download URL: pytest-percent-0.0.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0

File hashes

Hashes for pytest-percent-0.0.4.tar.gz
Algorithm Hash digest
SHA256 579c1e7488427253a1e7312969cfe4fce9f2fad5ab09d230a813cc788f6bcdc9
MD5 be11765e31abac6ab824b9b0a24b0a62
BLAKE2b-256 256eba142d8ae00e9e489ed99ca8f1bad35d69ab4a395f7804372436098582c6

See more details on using hashes here.

File details

Details for the file pytest_percent-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pytest_percent-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0

File hashes

Hashes for pytest_percent-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 15a586206b0353e1e56c4943c75b63f0c1bd90dfdf05e6307eff42f2c8ce4c68
MD5 3ab6acd1d0e0b29a75e1e23583507362
BLAKE2b-256 7ca8796dcb26f007203296f53466c146504171757bcd89050905cdfa9c996b16

See more details on using hashes here.

Supported by

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