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

Commit

Permalink
Set default ctx in conftest (#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
leezu authored Sep 15, 2020
1 parent 0e86648 commit 8ec0cc7
Showing 1 changed file with 4 additions and 1 deletion.
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])

0 comments on commit 8ec0cc7

Please sign in to comment.