astroquery/heasarc/tests/parametrization.py
def patch_get(request):
    """
    If the mode is not remote, patch `requests.Session` to either return saved local data or run save data new local data
    """
    mode = request.param
    mp = request.getfixturevalue("monkeypatch")

    if mode != "remote":
        requests.Session._original_request = requests.Session.request
        mp.setattr(
            requests.Session,
            "request",
            {"save": save_response_of_get, "local": get_mockreturn}[mode],
        )

    mp.assume_fileid_for_request = lambda patched_fileid_for_request: \
        mp.setattr('astroquery.heasarc.tests.parametrization.fileid_for_request', patched_fileid_for_request)

    mp.reset_default_fileid_for_request = lambda: \
        mp.delattr('astroquery.heasarc.tests.parametrization.fileid_for_request')

    return mp

    If the mode is not remote, patch `requests.Session` to either return saved local data or run save data new local data
    
If the mode is not remote, patch `requests.Session` to either return saved local data or run save data new local data
If the mode is not remote patch ` requests . Session ` to either return saved local data or run save data new local data
def patch_get(request):
    mode = request.param
    mp = request.getfixturevalue("monkeypatch")
    if mode != "remote":
        requests.Session._original_request = requests.Session.request
        mp.setattr(
            requests.Session,
            "request",
            {"save": save_response_of_get, "local": get_mockreturn}[mode],
        )
    mp.assume_fileid_for_request = lambda patched_fileid_for_request: \
        mp.setattr('astroquery.heasarc.tests.parametrization.fileid_for_request', patched_fileid_for_request)
    mp.reset_default_fileid_for_request = lambda: \
        mp.delattr('astroquery.heasarc.tests.parametrization.fileid_for_request')
    return mp
def patch_get ( request ) : mode = request . param mp = request . getfixturevalue ( "monkeypatch" ) if mode != "remote" : requests . Session . _original_request = requests . Session . request mp . setattr ( requests . Session , "request" , { "save" : save_response_of_get , "local" : get_mockreturn } [ mode ] , ) mp . assume_fileid_for_request = lambda patched_fileid_for_request : mp . setattr ( 'astroquery.heasarc.tests.parametrization.fileid_for_request' , patched_fileid_for_request ) mp . reset_default_fileid_for_request = lambda : mp . delattr ( 'astroquery.heasarc.tests.parametrization.fileid_for_request' ) return mp
If the mode is not remote, patch `requests.Session` to either return saved local data or run save data new local data
If the mode is not remote patch ` requests . Session ` to either return saved local data or run save data new local data
"""
    If the mode is not remote, patch `requests.Session` to either return saved local data or run save data new local data
    """
request