Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(237)

#26323: Add a assert_called() method for mock objects

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 8 months ago by amitsaha.in
Modified:
1 year, 8 months ago
Reviewers:
omalsa04, senthil, victor.stinner, amitsaha.in
CC:
haypo, rbcollins, Michael Foord, devnull_psf.upfronthosting.co.za, kushaldas, Amit Saha, python.org_the-compiler.org, Amit Saha
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 1

Patch Set 3 #

Total comments: 6

Patch Set 4 #

Total comments: 1

Patch Set 5 #

Total comments: 2

Patch Set 6 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/unittest.mock.rst View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
Doc/whatsnew/3.6.rst View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
Lib/unittest/mock.py View 1 2 3 4 5 1 chunk +18 lines, -0 lines 0 comments Download
Lib/unittest/test/testmock/testmock.py View 1 2 3 4 5 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 9
Sam
Can we also test that more than one call to hello() still passes the m.hello.asert_called()? ...
1 year, 8 months ago #1
Sam
http://bugs.python.org/review/26323/diff/16568/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): http://bugs.python.org/review/26323/diff/16568/Lib/unittest/test/testmock/testmock.py#newcode1231 Lib/unittest/test/testmock/testmock.py:1231: m.hello.assert_called() Can we also test that "m.hello.assert_called()" does not ...
1 year, 8 months ago #2
orsenthil
http://bugs.python.org/review/26323/diff/16599/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): http://bugs.python.org/review/26323/diff/16599/Lib/unittest/test/testmock/testmock.py#newcode1225 Lib/unittest/test/testmock/testmock.py:1225: #Issue26323 No need for these comments referencing issue numbers. ...
1 year, 8 months ago #3
haypo
http://bugs.python.org/review/26323/diff/16599/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): http://bugs.python.org/review/26323/diff/16599/Lib/unittest/test/testmock/testmock.py#newcode1231 Lib/unittest/test/testmock/testmock.py:1231: m.hello.assert_called() You must add a test when hello is ...
1 year, 8 months ago #4
haypo
http://bugs.python.org/review/26323/diff/16603/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): http://bugs.python.org/review/26323/diff/16603/Lib/unittest/test/testmock/testmock.py#newcode1231 Lib/unittest/test/testmock/testmock.py:1231: m.reset_mock() Hum, I don't like call reset_mock() here, it ...
1 year, 8 months ago #5
Amit Saha
http://bugs.python.org/review/26323/diff/16599/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): http://bugs.python.org/review/26323/diff/16599/Lib/unittest/test/testmock/testmock.py#newcode1225 Lib/unittest/test/testmock/testmock.py:1225: #Issue26323 On 2016/02/18 08:14:49, orsenthil wrote: > No need ...
1 year, 8 months ago #6
haypo
https://bugs.python.org/review/26323/diff/16609/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): https://bugs.python.org/review/26323/diff/16609/Lib/unittest/test/testmock/testmock.py#newcode1243 Lib/unittest/test/testmock/testmock.py:1243: m.reset_mock() Please don't use reset_mock() in the assert_called_once() test ...
1 year, 8 months ago #7
Amit Saha
https://bugs.python.org/review/26323/diff/16609/Lib/unittest/test/testmock/testmock.py File Lib/unittest/test/testmock/testmock.py (right): https://bugs.python.org/review/26323/diff/16609/Lib/unittest/test/testmock/testmock.py#newcode1243 Lib/unittest/test/testmock/testmock.py:1243: m.reset_mock() On 2016/02/22 00:17:33, haypo wrote: > Please don't ...
1 year, 8 months ago #8
haypo
1 year, 8 months ago #9
Please update the patch.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7