Exemplo n.º 1
0
def unpatch():
    """
    Unpatch any previously patched modules.
    This operation is idempotent.
    """
    _PATCHED_MODULES.discard('pymysql')
    unwrap(pymysql, 'connect')
Exemplo 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')
Exemplo 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')
Exemplo 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')