From cee2cb336abbe82717976d83798405c12bb66c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 17 Jun 2024 09:30:15 +0200 Subject: [PATCH] TST: adjust a `coordinates` test to avoid hardcoding exact data source url --- astropy/coordinates/tests/test_name_resolve.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/astropy/coordinates/tests/test_name_resolve.py b/astropy/coordinates/tests/test_name_resolve.py index 033c5ca26e2..a4b4e72e568 100644 --- a/astropy/coordinates/tests/test_name_resolve.py +++ b/astropy/coordinates/tests/test_name_resolve.py @@ -4,7 +4,6 @@ This module contains tests for the name resolve convenience module. """ -import re import time import urllib.request @@ -114,10 +113,8 @@ def test_names(): # "all" choice should ask for SIMBAD, then NED, then Vizier: "SNV" in the url with pytest.raises( NameResolveError, - match=re.escape( - "Unable to find coordinates for name 'm87h34hhh' " - "using https://cds.unistra.fr/cgi-bin/nph-sesame/SNV?m87h34hhh" - ), + # avoid hard-coding an exact url as it might depend on external state + match=r"Unable to find coordinates for name 'm87h34hhh' using http.*SNV.*", ): get_icrs_coordinates("m87h34hhh")