Update gammapy/irf/tests/test_effective_area.py
@@ -15,10 +15,15 @@ def aeff():
return EffectiveAreaTable2D.read(filename, hdu='AEFF_2D')
+class TestEffectiveAreaTable2D:
+
+ # TODO: split this out into separate tests, especially the plotting
+ # Add I/O test
+ @staticmethod
@requires_dependency('scipy')
@requires_dependency('matplotlib')
@requires_data('gammapy-extra')
-def test_EffectiveAreaTable2D(aeff):
+ def test(aeff):
assert aeff.data.axis('energy').nbins == 73
assert aeff.data.axis('offset').nbins == 6
assert aeff.data.data.shape == (73, 6)
@@ -59,6 +64,9 @@ def test_EffectiveAreaTable2D(aeff):
assert_equal(actual.value, desired.value)
+class TestEffectiveAreaTable:
+
+ @staticmethod
@requires_dependency('scipy')
@requires_dependency('matplotlib')
@requires_data('gammapy-extra')
@@ -97,8 +105,8 @@ def test_EffectiveAreaTable(tmpdir, aeff):
assert vals[1] == 0
assert vals[-1] == 3
-
-def test_EffectiveAreaTable_from_parametrization():
+ @staticmethod
+ def test_from_parametrization():
# Log center of this is 100 GeV
energy = [80, 125] * u.GeV
area_ref = 1.65469579e+07 * u.cm ** 2
@@ -118,8 +126,8 @@ def test_EffectiveAreaTable_from_parametrization():
# TODO: Use this to test interpolation behaviour etc.
-
-def test_EffectiveAreaTable2d_write():
+ @staticmethod
+ def test_write():
energy = np.logspace(0, 1, 11) * u.TeV
energy_lo = energy[:-1]
energy_hi = energy[1:]
