derwiki-adroll / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

There should be a patch.property method #205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It's very easy to implement but not trivial to figure out:
patch.object(SomeClass, 'some_property, new_callable=lambda: property(lambda _: 
'get', lambda _: 'set'))

Original issue reported on code.google.com by Omer.d...@gmail.com on 12 Jun 2013 at 2:04

GoogleCodeExporter commented 9 years ago
In recent versions of mock you use PropertyMock for this.

http://www.voidspace.org.uk/python/mock/mock.html#mock.PropertyMock

Original comment by fuzzyman on 12 Jun 2013 at 8:48