Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def record(
self,
request: Any,
response: Optional[Any],
pattern: Optional[RequestPattern] = None,
) -> None:
request = build_request(request)
response = build_response(response, request=request)
if pattern:
pattern.stats(request, response)
self.stats(request, response)
# Copy stats due to unwanted use of property refs in the high-level api
self.calls[:] = (
(request, response) for (request, response), _ in self.stats.call_args_list
)