Issue 32644: unittest.mock.call len() error (original) (raw)
In some testcase, an instance of unittest.mock.call was generated as:
call('solution', 'foo', {'spots': {}, 'event': None, 'solution': None})
The third argument is an instance of a derived component from dict.
In this issue, result of len() is 2 but not 3 as expected.
call objects inherit from tuple and here the reported argument is a dict with 3 items returning len of 3. I am closing this as part of triaging since there is no additional information from @snakevil on reproducing this. Feel free to reopen this if there is more information on reproducing the issue.
./python.exe Python 3.9.0a0 (heads/master:cb65202520, Jun 6 2019, 11:15:04) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from unittest.mock import call c = call('solution', 'foo', {'spots': {}, 'event': None, 'solution': None}) len(c.args[2]) 3 len(c) 3 c.args ('solution', 'foo', {'spots': {}, 'event': None, 'solution': None}) c.kwargs {}