Open GoogleCodeExporter opened 9 years ago
So this is when using patch as a class decorator?
This would be backwards incompatible to do it all automatically - but it could
be enabled with a flag.
You can achieve the same effect currently but doing the patching in the setUp -
calling patch.start() to put the patches in place and patch.stopall() in the
tearDown
Original comment by fuzzyman
on 8 Aug 2012 at 11:08
That was the idea. Can patch.start be called on all patches - or must it be
called once per patch (if I have 3 or 4)?
I cannot find the stopAll method in the documentation
(http://www.voidspace.org.uk/python/mock/).
Original comment by orionrobots
on 10 Aug 2012 at 8:08
stopall is new in 1.0 (still in beta). The docs are at:
http://mock.readthedocs.org/en/latest/index.html
For mock 0.8 you'll need to use patch.stop individually on patchers. There is
no patch.startall because patch.start returns the mock created by the patcher -
so generally you'll want to keep a reference to the return value.
Original comment by fuzzyman
on 10 Aug 2012 at 2:24
Original issue reported on code.google.com by
orionrobots
on 8 Aug 2012 at 11:06