File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ def test_distance_out_of_bounds_warning(recwarn):
358358
359359
360360@pytest .mark .skipif (SUNPY_VERSION < (7 , 1 ), reason = "Skip pre sunpy 7.1" )
361- def test_distance_out_of_bounds_warning_post71 ():
361+ def test_distance_out_of_bounds_warning_post71 (recwarn ):
362362 instrument = a .Instrument ("EUI" )
363363 time = a .Time ("2023-04-27" , "2023-04-28" )
364364 level = a .Level (2 )
@@ -367,7 +367,14 @@ def test_distance_out_of_bounds_warning_post71():
367367 # Run the search and ensure it raises an HTTPError
368368 query = Fido .search (distance & instrument & product & level & time )
369369 # Check if the warning was raised
370- assert "Distance values must be within the range 0.28 AU to 1.0 AU." in str (query ['soar' ].errors )
370+ assert query ['soar' ].errors
371+ # Check if the warning was raised
372+ warnings_list = recwarn .list
373+ assert any (
374+ warning .message .args [0 ] == "Distance values must be within the range 0.28 AU to 1.0 AU."
375+ and issubclass (warning .category , SunpyUserWarning )
376+ for warning in warnings_list
377+ )
371378
372379
373380# Remove this test and the mark from below once min sunpy dep >=7.1
You can’t perform that action at this time.
0 commit comments