From 8ec0cc7965a096fe064bf9d73d5c64d5f3b2b0cc Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Tue, 15 Sep 2020 05:15:34 +0000 Subject: [PATCH] Set default ctx in conftest (#1363) --- conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 2dcd6a27bf..86342eae32 100644 --- a/conftest.py +++ b/conftest.py @@ -228,5 +228,8 @@ def pytest_collection_modifyitems(config, items): def pytest_generate_tests(metafunc): + devices = metafunc.config.option.device + if not devices: + devices = ['cpu'] if 'ctx' in metafunc.fixturenames: - metafunc.parametrize("ctx", [getattr(mx, device)() for device in metafunc.config.option.device]) + metafunc.parametrize("ctx", [getattr(mx, device)() for device in devices])