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:
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.1.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for pytest_percent-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25387591872cdfd011689f530e401015e98b2eec0044d0d8d2454893dadc7ffc |
|
MD5 | 3585ce8b06d84263ad4f1995f100b227 |
|
BLAKE2b-256 | e0af9c9b79423157c8cc7f3a8656828db0b7e11a5a9da63d24a3a50c98ac1cb7 |