You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copying an instance of a Mock object with the copy module breaks the function
of coverage for subsequent lines of code.
Win32 Python 2.5.4
Latest mock (0.7something)
Latest coverage snapshot but old versions of it do it too, like the ancient
version that comes with eclipse pydev.
I opened a ticket in coverage as well:
http://bitbucket.org/ned/coveragepy/issue/93/copying-a-mock-object-breaks-covera
ge#comment-262518
Original issue reported on code.google.com by jeff.lau...@gmail.com on 7 Oct 2010 at 4:35
The text was updated successfully, but these errors were encountered:
This is due to an infinite recursion in Mock.__getattr__. Add this to the top
to fix the problem:
def __getattr__(self, name):
if name == "_methods":
raise AttributeError(name)
Original comment by ned...@gmail.com on 7 Oct 2010 at 2:12
Fixed, but the test is a bit brutal (call sys.setrecursionlimit(sys.maxint) and
copying a Mock segfaults without the fix). I did try the sys.settrace trick,
but for some reason that didn't work (the trace function wasn't removed during
the test even after the recursion).
Original comment by fuzzyman on 18 Oct 2010 at 9:36
Original issue reported on code.google.com by
jeff.lau...@gmail.com
on 7 Oct 2010 at 4:35The text was updated successfully, but these errors were encountered: