monkey/envs/monkey_zoo/blackbox/conftest.py

43 lines
1.0 KiB
Python
Raw Normal View History

import pytest
2019-08-29 19:57:04 +08:00
def pytest_addoption(parser):
2021-04-06 21:19:27 +08:00
parser.addoption(
"--island",
action="store",
default="",
help="Specify the Monkey Island address (host+port).",
)
parser.addoption(
"--no-gcp",
action="store_true",
default=False,
help="Use for no interaction with the cloud.",
)
parser.addoption(
"--skip-powershell-reuse",
action="store_true",
default=False,
help="Use to run PowerShell credentials reuse test.",
)
2021-04-06 21:19:27 +08:00
@pytest.fixture(scope="session")
def island(request):
return request.config.getoption("--island")
2021-04-06 21:19:27 +08:00
@pytest.fixture(scope="session")
def no_gcp(request):
return request.config.getoption("--no-gcp")
def pytest_runtest_setup(item):
if "skip_powershell_reuse" in item.keywords and item.config.getoption(
"--skip-powershell-reuse"
):
pytest.skip(
"Skipping powershell credentials reuse test because "
"--skip-powershell-cached flag isn't specified."
)