From a967c63b1fd99d25ba5834df2099d422916f7018 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:58:23 -0500 Subject: [PATCH] Backport PR #3283: TST: Skip chronically failing test --- jdaviz/app.py | 6 +++++- jdaviz/configs/mosviz/tests/test_parsers.py | 7 ++++++- jdaviz/tests/test_utils.py | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/jdaviz/app.py b/jdaviz/app.py index bd1260a200..fcb7c47c0d 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -848,7 +848,11 @@ def load_data(self, file_obj, parser_reference=None, **kwargs): parser = data_parser_registry.members.get(data_parser) if parser is not None: - parser(self, file_obj, **kwargs) + with warnings.catch_warnings(): + # https://github.com/spacetelescope/gwcs/pull/522 + warnings.filterwarnings( + "ignore", message="The bounding_box was set in C order.*") + parser(self, file_obj, **kwargs) else: self._application_handler.load_data(file_obj) diff --git a/jdaviz/configs/mosviz/tests/test_parsers.py b/jdaviz/configs/mosviz/tests/test_parsers.py index a0c7da8dbf..10ccb2c0aa 100644 --- a/jdaviz/configs/mosviz/tests/test_parsers.py +++ b/jdaviz/configs/mosviz/tests/test_parsers.py @@ -1,3 +1,4 @@ +import warnings from zipfile import ZipFile import pytest @@ -145,7 +146,11 @@ def test_niriss_parser(mosviz_helper, tmp_path): imview = mosviz_helper.app.get_viewer(mosviz_helper._default_image_viewer_reference_name) x_pixcenter = (imview.state.x_max + imview.state.x_min)/2.0 y_pixcenter = (imview.state.y_max + imview.state.y_min)/2.0 - viewer_center_coord = imview.layers[0].layer.coords.pixel_to_world(x_pixcenter, y_pixcenter) + with warnings.catch_warnings(): + # https://github.com/spacetelescope/gwcs/pull/522 + warnings.filterwarnings( + "ignore", message="The bounding_box was set in C order.*") + viewer_center_coord = imview.layers[0].layer.coords.pixel_to_world(x_pixcenter, y_pixcenter) assert_allclose(viewer_center_coord.ra.deg, dc_tab["R.A."][0]) assert_allclose(viewer_center_coord.dec.deg, dc_tab["Dec."][0]) diff --git a/jdaviz/tests/test_utils.py b/jdaviz/tests/test_utils.py index 7e6d914124..8569bfb0e7 100644 --- a/jdaviz/tests/test_utils.py +++ b/jdaviz/tests/test_utils.py @@ -210,6 +210,7 @@ def test_uri_to_download_specviz(specviz_helper, tmp_path): specviz_helper.load_data(uri, cache=True, local_path=local_path) +@pytest.mark.skip(reason="FIXME: Find a file that is not missing from MAST") @pytest.mark.remote_data def test_uri_to_download_specviz2d(specviz2d_helper, tmp_path): uri = "mast:JWST/product/jw01324-o006_s00005_nirspec_f100lp-g140h_s2d.fits"