Reproduction
from unittest.mock import Mock
from responses import matchers
matcher = matchers.json_params_matcher({"page": 1}, strict_match=False)
matcher(Mock(body='{"page": {"type": "json"}}'))
Current behavior
The matcher raises TypeError: argument of type 'int' is not a container or iterable.
_filter_dict_recursively recurses whenever the actual value is a dictionary, even if the expected value at the same key is a scalar.
Expected behavior
This is an ordinary mismatch, so the matcher should return (False, reason) instead of raising. Non-strict matching should still recurse when both values are dictionaries.
I have a small fix and regression test ready.
AI assistance disclosure
OpenAI Codex (GPT-5) assisted with investigation, the reproducer, regression test, implementation, and drafting this report. I reviewed the changes and ran the relevant tests locally.
Reproduction
Current behavior
The matcher raises
TypeError: argument of type 'int' is not a container or iterable._filter_dict_recursivelyrecurses whenever the actual value is a dictionary, even if the expected value at the same key is a scalar.Expected behavior
This is an ordinary mismatch, so the matcher should return
(False, reason)instead of raising. Non-strict matching should still recurse when both values are dictionaries.I have a small fix and regression test ready.
AI assistance disclosure
OpenAI Codex (GPT-5) assisted with investigation, the reproducer, regression test, implementation, and drafting this report. I reviewed the changes and ran the relevant tests locally.