Closed GoogleCodeExporter closed 9 years ago
Well, it would be an incompatible change to patch - so if it *was* to be built
into mock it would have to have a different name. It's a neat idea but I don't
think it needs to be in mock itself. If you post it as a recipe on a blog (or
here) I'll happily put it in the advanced example page of the docs though.
Consider this problem though, patching is always done as a *dotted name*. e.g.
@patch('os.path.split')
def test(p):
...
Should this be p.os.path.split or p.split ? If the former then you have to
construct the useless intermediate objects. If the latter, what do you do here:
@patch('os.path.split')
@patch('re.split')
def test(p):
...
Which mock does "p.split" point to?
Original comment by fuzzyman
on 4 Mar 2012 at 12:00
Original issue reported on code.google.com by
k...@k-bx.com
on 3 Mar 2012 at 1:55