Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Set default ctx in conftest #1363

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])