==========
Pigeonhole
==========

`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.param

  * `test_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):
            pass

  * calling `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   

