Skip to main content

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

Project description



pip install pytest-percent


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


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/ PASSED                                                                                                                                                                                                                                                                       [ 20%]
tests/ PASSED                                                                                                                                                                                                                                                                       [ 40%]
tests/ PASSED                                                                                                                                                                                                                                                                     [ 60%]
tests/ PASSED                                                                                                                                                                                                                                                                      [ 80%]
tests/ FAILED                                                                                                                                                                                                                                                                      [100%]
--------------------------------------------------------------------------------------------------------------------------------------------- live log sessionfinish ----------------------------------------------------------------------------------------------------------------------------------------------
INFO 80% of tests passed, required 80%.

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

    def test_five():
>       assert False
E       assert False

tests\ AssertionError
========================= 1 failed, 4 passed in 0.10s =========================

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


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


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.

Files for pytest-percent, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pytest_percent-0.0.4-py3-none-any.whl (3.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytest-percent-0.0.4.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page