【发布时间】:2014-05-07 02:50:40
【问题描述】:
例如在 t.py 中
def a(obj):
print obj
def b():
a(1)
a(2)
然后:
from t import b
with patch('t.a') as m:
b()
m.assert_called_with(1)
我明白了:
AssertionError: Expected call: a(1)
Actual call: a(2)
【问题讨论】: