You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
453 B
12 lines
453 B
def pytest_addoption(parser):
|
|
parser.addoption("--device", action="store", default="cpu")
|
|
|
|
|
|
def pytest_generate_tests(metafunc):
|
|
# This is called for every test. Only get/set command line arguments
|
|
# if the argument is specified in the list of test "fixturenames".
|
|
option_value = metafunc.config.option.device
|
|
if "device" in metafunc.fixturenames and option_value is not None:
|
|
metafunc.parametrize("device", [option_value])
|
|
|