No project description provided
Project description
pytest-pigeonhole is a pytest plugin that adds a terminal-summary in whose outcomes are splitted along given fixture value.
Usage
Install the plugin and then add –pigeonhole given_fixture_name parameter to your pytest run. That’s all.
Alternativelly you can either add such to your conftest.py:
from pigeonhole.plugin import configure_pigeonhole def pytest_configure(config): configure_pigeonhole(config, "given_fixture_name")
Or such statement to pytest.ini or tox.ini:
[pytest] addopts = –pigeonhole given_fixture_name
Each of above gives the same result.
Usage example:
conftest.py:
import pytest from pigeonhole.plugin import configure_pigeonhole def pytest_configure(config): configure_pigeonhole(config, "that_fixture") @pytest.fixture(params=["one", "two", 23, False]) def that_fixture(request): return request.param @pytest.fixture(params=range(3)) def int_fixture(request): return request.paramtest_usage.py:
import pytest @pytest.fixture def faulty_setup(that_fixture): assert not that_fixture def test_passes(that_fixture): pass def test_int_passes(int_fixture): if not int_fixture: pytest.skip() def test_fail(that_fixture, int_fixture): assert int_fixture def test_errors(faulty_setup): passcalling pytest adds terminal-report (without additional commandline arguments):
============= Pigeonhole: that_fixture ========= 'one' | p: 3 | f: 1 | s: 0 | e: 1 'two' | p: 3 | f: 1 | s: 0 | e: 1 23 | p: 3 | f: 1 | s: 0 | e: 1 False | p: 4 | f: 1 | s: 0 | e: 0 N/A | p: 2 | f: 0 | s: 1 | e: 0
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-pigeonhole-0.2.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for pytest_pigeonhole-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f8f727edd32aa7caf573ea4abba48c6dd0f52b8db819acfa618ec8db5c5d9a4 |
|
MD5 | b1bbdd865ef783e33a333a8bb1548fcc |
|
BLAKE2b-256 | 13075ccaf652ecc51630f37a6fa9a993df5d8ecb15b9c5e98082abf77a79600e |