Re: unittest inconsistent

2010-01-12 Thread Chris Withers
Phlip wrote: The reason the 'Tester' object has no attribute 'arg1' is because "self" still refers to the object made for testA. I hope someone else can spot the low-level reason... ...but why aren't you using http://pypi.python.org/pypi/mock/ ? Look up its patch_object facility... Indeed, I

unittest inconsistent

2010-01-06 Thread Matt Haggard
Can anyone tell me why this test fails? http://pastebin.com/f20039b17 This is a minimal example of a much more complex thing I'm trying to do. I'm trying to hijack a function and inspect the args passed to it by another function. The reason the 'Tester' object has no attribute 'arg1' is because

Re: unittest inconsistent

2010-01-06 Thread Peter Otten
André wrote: > On Jan 5, 8:14 pm, Matt Haggard wrote: >> Can anyone tell me why this test fails? >> >> http://pastebin.com/f20039b17 >> >> This is a minimal example of a much more complex thing I'm trying to >> do. I'm trying to hijack a function and inspect the args passed to it >> by another f

Re: unittest inconsistent

2010-01-05 Thread André
On Jan 5, 8:14 pm, Matt Haggard wrote: > Can anyone tell me why this test fails? > > http://pastebin.com/f20039b17 > > This is a minimal example of a much more complex thing I'm trying to > do.  I'm trying to hijack a function and inspect the args passed to it > by another function. > > The reason

Re: unittest inconsistent

2010-01-05 Thread Phlip
On Jan 5, 4:14 pm, Matt Haggard wrote: > Can anyone tell me why this test fails? > > http://pastebin.com/f20039b17 > > This is a minimal example of a much more complex thing I'm trying to > do.  I'm trying to hijack a function and inspect the args passed to it > by another function. > > The reason