This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rbcollins
Recipients rbcollins
Date 2015-07-17.09:40:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437126004.09.0.453747784975.issue24653@psf.upfronthosting.co.za>
In-reply-to
Content
From https://github.com/testing-cabal/mock/issues/243

from unittest import mock
mmock = mock.MagicMock()
mmock.foobar("baz")
mmock.assert_has_calls([])  # No exception raised. Why?mmock.assert_has_calls(['x'])  # Exception raised as expected.

---

Traceback (most recent call last):
  File "tt.py", line 7, in <module>
    mmock.assert_has_calls(['x'])  # Exception raised as expected.
  File "/home/robertc/work/cpython/Lib/unittest/mock.py", line 824, in assert_has_calls
    ) from cause
AssertionError: Calls not found.
Expected: ['x']
Actual: [call.foobar('baz')]
History
Date User Action Args
2015-07-17 09:40:04rbcollinssetrecipients: + rbcollins
2015-07-17 09:40:04rbcollinssetmessageid: <1437126004.09.0.453747784975.issue24653@psf.upfronthosting.co.za>
2015-07-17 09:40:04rbcollinslinkissue24653 messages
2015-07-17 09:40:03rbcollinscreate