qibolab
qibolab copied to clipboard
Skip tests when optional dependencies are not available
https://github.com/qiboteam/qibolab/pull/994#discussion_r1723546739
This can be done with pytest.importorskip()
in the modules explicitly importing it, and by manually catching ModuleNotFoundError
in the platform
and connected_platform
fixtures
https://github.com/qiboteam/qibolab/blob/f310266553c2c4789e10d5c226b92a66de96e242/tests/conftest.py#L99-L127
by manually invoking pytest.skip()
.