cover missing line by test
@@ -7,6 +7,7 @@ from regions import CircleSkyRegion, RectangleSkyRegion
from gammapy.data import EventList, GTI
from gammapy.maps import MapAxis, WcsGeom
from gammapy.utils.testing import mpl_plot_check, requires_data, requires_dependency
+import pytest
@requires_data()
@@ -46,6 +47,11 @@ class TestEventListBase:
assert gti.table.meta == read_again_gti.table.meta
assert (gti.table == read_again_gti.table).all()
+ # test that it won't work if gti is not a GTI
+ with pytest.raises(TypeError):
+ self.events.write("test.fits", overwrite=True, gti=gti.table)
+
+
@requires_data()
class TestEventListHESS:
def setup_class(self):
