Я пытаюсь запустить pytest с пользовательским входным аргументом "--trustkey_jks".
Работает так:
sh-4.2$ pytest -m test_e2e.py --trustkey_jks somekey
ERROR: usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: argument --trustkey_jks: expected one argument
Также пробовал так:
sh-4.2$ py.test --trustkey_jks somekey test_e2e.py
ERROR: usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: argument --trustkey_jks: expected one argument
Может опустить имя файла, чтобы pytest мог собирать любые тесты:
sh-4.2$ py.test --trustkey_jks somekey
ERROR: usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: argument --trustkey_jks: expected one argument
Мой conftest.py (такой же уровень, как tests_e2e.py):
# conftest.py
def pytest_addoption(parser):
parser.addoption("--trustkey_jks", action="store")
@pytest.fixture()
def trustkey_jks(request):
return request.config.getoption("--trustkey_jks")
Насколько далекокак я понимаю, pytest не в состоянии разбирать входные аргументы.Цени любую помощь.
ПРИМЕЧАНИЕ: все вышеперечисленное происходит внутри POD Openshift, но не уверен, что это важно.