wishlist: ability to patch class staticmethods and classmethods

Bug #733655 reported by Eduardo Habkost
6
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: wishlist
tags: added: wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.