Closed GoogleCodeExporter closed 9 years ago
Hello. I've seen that error as well and have fixed it (on trunk) for *some*
cases (specifically when self is used as an argument anywhere *other* than the
first argument to a method or function).
Could you show the definition of module.Class that is problematic so I can
reproduce the issue and see whether or not I have already fixed it please.
Original comment by fuzzyman
on 28 Jun 2011 at 2:36
Thanks for your quick reply.
I can send you the module but unfortunately it is not loosely coupled and is
using other external modules from Twisted.
In my case it fails when accessing the home_segments property.
Please let me know if you need the whole code.
Original comment by adiroi...@gmail.com
on 28 Jun 2011 at 2:58
Attachments:
I can't reproduce the bug from that I'm afraid. Is there a minimal repro you
can find?
Certainly passing a class with a property, defined in the same way as
'home_segments', to autospec works.
Original comment by fuzzyman
on 28 Jun 2011 at 3:11
Alternatively you could try your tests with mock.py from the mercurial repo and
see if it is fixed.
I like to know *why* problems happen though - and what you're describing
doesn't sound identical to the one I fixed. Maybe though.
Original comment by fuzzyman
on 28 Jun 2011 at 3:15
I have tried my tests with mock.py and the problem is fixed.
I will try to create a test that fails in my case using the alpha1 code.
I have attached a more complete class.
It fails when I try to make a call similar to this one:
normal_filesystem = LocalUnixFilesystem()
normal_filesystem.createFolder(
segments=normal_filesystem.home_segments,
recursive=False)
Original comment by adiroi...@gmail.com
on 28 Jun 2011 at 3:29
Attachments:
As far as I can tell this works now, so closing the issue. Please create a new
issue if the problem recurs.
Original comment by fuzzyman
on 1 Jul 2011 at 11:40
Original issue reported on code.google.com by
adiroi...@gmail.com
on 28 Jun 2011 at 2:22