Skip to content

Commit

Permalink
in heasarc.test, move patch_get to class level to allow for other cla…
Browse files Browse the repository at this point in the history
…sses that do not need it
  • Loading branch information
zoghbi-a committed Sep 25, 2023
1 parent 072af52 commit 7e5f569
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion astroquery/heasarc/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def save_response_of_get(session, method, url, params=None, timeout=10, **kwargs
return MockResponse(text)


@pytest.fixture(autouse=True)
@pytest.fixture()
def patch_get(request):
"""
If the mode is not remote, patch `requests.Session` to either return saved local data
Expand Down
5 changes: 5 additions & 0 deletions astroquery/heasarc/tests/test_heasarc_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

@parametrization_local_save_remote
class TestHeasarc:

@pytest.fixture(autouse=True)
def _patch_get(self, patch_get):
return patch_get

def test_custom_args(self):
object_name = 'Crab'
mission = 'intscw'
Expand Down
5 changes: 5 additions & 0 deletions astroquery/heasarc/tests/test_heasarc_remote_isdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
@parametrization_local_save_remote
class TestHeasarcISDC:


@pytest.fixture(autouse=True)
def _patch_get(self, patch_get):
return patch_get

@property
def isdc_context(self):
return Conf.server.set_temp(
Expand Down

0 comments on commit 7e5f569

Please sign in to comment.