Fix memory leak when comparing requests (#6764)
This commit is contained in:
parent
cfb3e428d3
commit
7f3a69b7a5
@ -26,9 +26,11 @@ class CustomRegistry(responses.registries.FirstMatchRegistry):
|
|||||||
self._registered.clear()
|
self._registered.clear()
|
||||||
|
|
||||||
def find(self, request: Any) -> Tuple[Optional[responses.BaseResponse], List[str]]:
|
def find(self, request: Any) -> Tuple[Optional[responses.BaseResponse], List[str]]:
|
||||||
all_possibles = responses._default_mock._registry.registered
|
|
||||||
# We don't have to search through all possible methods - only the ones registered for this particular method
|
# We don't have to search through all possible methods - only the ones registered for this particular method
|
||||||
all_possibles.extend(self._registered[request.method])
|
all_possibles = (
|
||||||
|
responses._default_mock._registry.registered
|
||||||
|
+ self._registered[request.method]
|
||||||
|
)
|
||||||
found = []
|
found = []
|
||||||
match_failed_reasons = []
|
match_failed_reasons = []
|
||||||
for response in all_possibles:
|
for response in all_possibles:
|
||||||
|
Loading…
Reference in New Issue
Block a user