def tearDown(test): from lazr.restful.example.base.interfaces import IFileManager from zope.component import getUtility uninstall() file_manager = getUtility(IFileManager) file_manager.files = {} file_manager.counter = 0
def tearDown(self): if not skip_httpclient: http_client_intercept.uninstall() if not skip_httplib2: httplib2_intercept.uninstall() if not skip_requests: requests_intercept.uninstall() if not skip_urllib: urllib_intercept.uninstall_opener()
def teardown_intercept(self): """Remove the installed WSGI intercepts.""" for host, port in self.intercepted: remove_wsgi_intercept(host, port) if self.intercept_api: uninstall() uninstall_opener() self.unpatch_wsgi_intercept()
def uninstall_opener(): # httplib unpatch from wsgi_intercept.httplib2_intercept import uninstall uninstall() # requests' unpatch import wsgi_intercept from requests.packages.urllib3 import connectionpool connectionpool.HTTPConnection = connectionpool.old_http connectionpool.HTTPSConnection = connectionpool.old_https connectionpool.HTTPConnectionPool.ConnectionCls = connectionpool.old_http connectionpool.HTTPSConnectionPool.ConnectionCls = connectionpool.old_https
def uninstall(): wsgi_intercept.debuglevel = _saved_debuglevel httplib2_intercept.uninstall()
def http_uninstall(): wsgi_intercept.debuglevel = _saved_debuglevel wsgi_intercept.remove_wsgi_intercept( 'some_hopefully_nonexistant_domain', 80) uninstall()
def http_uninstall(): wsgi_intercept.remove_wsgi_intercept('some_hopefully_nonexistant_domain', 80) uninstall()
def uninstall(): httplib2_intercept.uninstall()
def teardown(): warnings.resetwarnings() wsgi_intercept.debuglevel = _saved_debuglevel uninstall()
def http_uninstall(): wsgi_intercept.debuglevel = _saved_debuglevel wsgi_intercept.remove_wsgi_intercept('some_hopefully_nonexistant_domain', 80) uninstall()
def http_uninstall(): wsgi_intercept.remove_wsgi_intercept( 'some_hopefully_nonexistant_domain', 80) uninstall()