wishlist: ability to patch class staticmethods and classmethods
Bug #733655 reported by
Eduardo Habkost
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mocker |
New
|
Undecided
|
Unassigned |
Bug Description
I would like to be able to do the following:
------------------
import mocker
class O(object):
@staticmethod
def foo(a):
return a
m = mocker.Mocker()
mO = m.patch(O)
mO.foo('x')
m.result('y')
m.replay()
assert O.foo('x') == 'y'
-----------------
I have actually tried to do it, expecting it to work, and I took some time to notice that it was not really supported.
tags: | added: wishlist |
To post a comment you must log in.