code: def requests_request(method, url, **kwargs):
      
      session = local_sessions.session
      response = session.request(method=method, url=url, **kwargs)
      session.close()
      return response
docs: Requests-mock requests.request wrapper.