mark test required dependencies
@@ -93,6 +93,11 @@ def get_test_cases():
e_true = Quantity(np.logspace(-1, 2, 120), 'TeV')
e_reco = Quantity(np.logspace(-1, 2, 100), 'TeV')
+ try:
+ import scipy
+ except ImportError:
+ return []
+ else:
return [
dict(model=PowerLaw(index=2,
reference=Quantity(1, 'TeV'),
@@ -115,6 +120,8 @@ def get_test_cases():
]
+
+@requires_dependency('scipy')
@pytest.mark.parametrize('case', get_test_cases())
def test_counts_predictor(case):
desired = case.pop('npred')
