-
Notifications
You must be signed in to change notification settings - Fork 22
/
conftest.py
34 lines (27 loc) · 856 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# content of conftest.py
import pytest
try:
import safe_exploration.ssm_gpy
safe_exploration.ssm_gpy.__name__
_has_ssm_gpy_ = True
except:
_has_ssm_gpy_ = False
try:
import safe_exploration.ssm_pytorch
safe_exploration.ssm_pytorch.__name__
_has_ssm_pytorch = True
except:
_has_ssm_pytorch = False
collect_ignore = ["setup.py"]
if not _has_ssm_gpy_:
collect_ignore.append("safe_exploration/ssm_gpy")
if not _has_ssm_pytorch:
collect_ignore.append("safe_exploration/ssm_pytorch")
@pytest.fixture(scope="session")
def check_has_ssm_pytorch():
if not _has_ssm_pytorch:
pytest.skip("Optional package 'ssm_pytorch' required to run this test")
@pytest.fixture(scope="session")
def check_has_ssm_gpy():
if not _has_ssm_gpy_:
pytest.skip("Optional package 'ssm_gpy' required to run this test")