Skip to content

Commit 8d61379

Browse files
committed
Monkeypatch that is compatible with astropy>=4.3
1 parent f7940f9 commit 8d61379

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

astroquery/utils/tests/test_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ def patch_getreadablefileobj(request):
410410
# Monkeypatch hack: ALWAYS treat as a URL
411411
_is_url = aud._is_url
412412
aud._is_url = lambda x: True
413+
_try_url_open = aud._try_url_open
414+
aud._try_url_open = lambda x, **kwargs: MockRemote(x, **kwargs)
413415
_urlopen = urllib.request.urlopen
414416
_urlopener = urllib.request.build_opener
415417
_urlrequest = urllib.request.Request
@@ -457,6 +459,7 @@ def monkey_urlrequest(x, *args, **kwargs):
457459

458460
def closing():
459461
aud._is_url = _is_url
462+
aud._try_url_open = _try_url_open
460463
urllib.request.urlopen = _urlopen
461464
aud.urllib.request.urlopen = _urlopen
462465
urllib.request.build_opener = _urlopener

0 commit comments

Comments
 (0)