from unittest import mock d = {} m1 = mock.Mock() m1(d) d[1] = 1 m1.assert_called_once_with({})