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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
From: Ole Streicher <olebole@debian.org>
Date: Tue, 7 Jun 2022 10:59:30 +0200
Subject: Don't run tests that are too large for 32 bit on those platforms
---
gammapy/datasets/tests/test_evaluator.py | 3 +++
gammapy/maps/region/tests/test_ndmap.py | 2 ++
gammapy/modeling/models/tests/test_cube.py | 2 ++
gammapy/modeling/models/tests/test_spatial.py | 2 ++
4 files changed, 9 insertions(+)
diff --git a/gammapy/datasets/tests/test_evaluator.py b/gammapy/datasets/tests/test_evaluator.py
index 1d1f3ac..11678d9 100644
--- a/gammapy/datasets/tests/test_evaluator.py
+++ b/gammapy/datasets/tests/test_evaluator.py
@@ -6,6 +6,8 @@ from numpy.testing import assert_allclose
import astropy.units as u
from astropy.coordinates import SkyCoord
from regions import CircleSkyRegion
+import pytest
+import sys
from gammapy.datasets.evaluator import MapEvaluator
from gammapy.irf import PSFKernel, RecoPSFMap
from gammapy.maps import Map, MapAxis, RegionGeom, RegionNDMap, WcsGeom
@@ -22,6 +24,7 @@ from gammapy.utils.testing import mpl_plot_check
@pytest.fixture
+@pytest.mark.skipif(sys.maxsize <= 2**32, reason="Doesn't run on 32-bit platforms")
def evaluator():
center = SkyCoord("0 deg", "0 deg", frame="galactic")
region = CircleSkyRegion(center=center, radius=0.1 * u.deg)
diff --git a/gammapy/maps/region/tests/test_ndmap.py b/gammapy/maps/region/tests/test_ndmap.py
index 2424e3f..3faeda6 100644
--- a/gammapy/maps/region/tests/test_ndmap.py
+++ b/gammapy/maps/region/tests/test_ndmap.py
@@ -6,6 +6,7 @@ from astropy import units as u
from astropy.time import Time
from regions import CircleSkyRegion
import matplotlib.pyplot as plt
+import sys
from gammapy.data import EventList
from gammapy.maps import (
LabelMapAxis,
@@ -288,6 +289,7 @@ def test_region_nd_map_resample_axis():
assert_allclose(m3.data, 2)
+@pytest.mark.skipif(sys.maxsize <= 2**32, reason="Doesn't run on 32-bit platforms")
def test_region_nd_io_ogip(tmpdir):
energy_axis = MapAxis.from_energy_bounds(0.1, 10, 12, unit="TeV")
m = RegionNDMap.create(
diff --git a/gammapy/modeling/models/tests/test_cube.py b/gammapy/modeling/models/tests/test_cube.py
index d68d22e..1d72e2e 100644
--- a/gammapy/modeling/models/tests/test_cube.py
+++ b/gammapy/modeling/models/tests/test_cube.py
@@ -7,6 +7,7 @@ import astropy.units as u
from astropy.coordinates import SkyCoord, angular_separation
from astropy.time import Time
from regions import CircleSkyRegion
+import sys
from gammapy.data.gti import GTI
from gammapy.datasets.map import MapEvaluator
from gammapy.irf import EDispKernel, PSFKernel
@@ -760,6 +761,7 @@ def test_sky_model_create():
assert m.name == "my-source"
+@pytest.mark.skipif(sys.maxsize <= 2**32, reason="Doesn't run on 32-bit platforms")
def test_integrate_geom():
model = GaussianSpatialModel(
lon_0="0 deg", lat_0="0 deg", sigma=0.1 * u.deg, frame="icrs"
diff --git a/gammapy/modeling/models/tests/test_spatial.py b/gammapy/modeling/models/tests/test_spatial.py
index 675fece..07dcdf1 100644
--- a/gammapy/modeling/models/tests/test_spatial.py
+++ b/gammapy/modeling/models/tests/test_spatial.py
@@ -599,6 +599,8 @@ def test_spatial_model_plot_error(model_class, extension_param):
model.plot_error(ax=ax, which="extension")
+import sys
+@pytest.mark.skipif(sys.maxsize <= 2**32, reason="Doesn't run on 32-bit platforms")
def test_integrate_region_geom():
center = SkyCoord("0d", "0d", frame="icrs")
model = GaussianSpatialModel(
|