Skip to content
Snippets Groups Projects
conftest.py 494 B
Newer Older
Varac's avatar
Varac committed
import pytest


def pytest_addoption(parser):
    """Add option `--app` to select specific app to test.

    See https://docs.pytest.org/en/stable/example/simple.html#pass-different-values-to-a-test-function-depending-on-command-line-options
    """
    parser.addoption(
        "--app", action="store", default="all",
        help="Name of the app to test, default: all"
    )


@pytest.fixture
def app(request):
    """Process new cli option."""
    return request.config.getoption("--app")