Esempio n. 1
0
def unpatch():
    """
    Unpatch any previously patched modules.
    This operation is idempotent.
    """
    _PATCHED_MODULES.discard('pymysql')
    unwrap(pymysql, 'connect')
Esempio n. 2
0
def unpatch():
    """
    Unpatch any previously patched modules.
    This operation is idempotent.
    """
    _PATCHED_MODULES.discard('sqlalchemy_core')
    import sqlalchemy
    unwrap(sqlalchemy.engine.base.Connection, 'execute')
Esempio n. 3
0
def unpatch():
    """
    Unpatch any previously patched modules.
    This operation is idempotent.
    """
    setattr(httplib, PATCH_FLAG, False)
    # _send_request encapsulates putrequest, putheader[s], and endheaders
    unwrap(httplib.HTTPConnection, '_send_request')
    unwrap(httplib.HTTPConnection, 'getresponse')
    unwrap(httplib.HTTPResponse, 'read')
Esempio n. 4
0
def unpatch():
    """ unpatch any previously patched modules """
    if not getattr(httplib, '__xray_patch', False):
        return
    setattr(httplib, '__xray_patch', False)

    # send_request encapsulates putrequest, putheader[s], and endheaders
    # NOTE that requests
    unwrap(httplib.HTTPConnection, '_send_request')
    unwrap(httplib.HTTPConnection, 'getresponse')
    unwrap(httplib.HTTPConnection, 'read')