[Buildbot-commits] [Buildbot] #2754: Remove mock.assert_called everywhree

Buildbot trac trac at buildbot.net
Sun Apr 13 14:59:12 UTC 2014


#2754: Remove mock.assert_called everywhree
------------------------+---------------------------
Reporter:  dustin       |      Owner:
    Type:  enhancement  |     Status:  new
Priority:  minor        |  Milestone:  0.8.+
 Version:  0.8.8        |   Keywords:  simple, tests
------------------------+---------------------------
 Mock doesn't have an 'assert_called' method, so calling that method in a
 test will always succeed, leading to useless tests.

 Seek and destroy calls to the method, and replace them with
 `assert_called_with()`.  For bonus points, monkey-patch mock.Mock so that
 calling assert_called will always fail.

 I don't think we should make `assert_called` do what it says, because that
 will encourage bad habits which developers might apply in other contexts.

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2754>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list