diff --git a/test/conftest.py b/test/conftest.py index 0edcc1ac9a5e1a8552db02477ab25f3925300a6f..c865ae39b7c79a609e88996b53011ba4b7321d2a 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -2,7 +2,9 @@ import pytest def pytest_addoption(parser): - """Add option `--app` to select specific app to test. + """Add pytest options: + --app: Select specific app to test + --namespace: Use specific namespace to look for app See https://docs.pytest.org/en/stable/example/simple.html#pass-different-values-to-a-test-function-depending-on-command-line-options """ @@ -11,8 +13,18 @@ def pytest_addoption(parser): help="Name of the app to test, default: all" ) + parser.addoption( + "--namespace", action="store", default="", + help="Namespace of the app to test, default: <empty>" + ) + @pytest.fixture def app(request): """Process new cli option.""" return request.config.getoption("--app") + +@pytest.fixture +def namespace(request): + """Process new cli option.""" + return request.config.getoption("--namespace")