Wednesday, October 17, 2012

Difference between mock and MagicMock


>>> x = mock.MagicMock(tst='abc')
>>> x[0]


>>> x = mock.Mock(tst='abc')

>>> x[0]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'Mock' object does not support indexing

No comments:

Post a Comment