glasser / pymox

Automatically exported from code.google.com/p/pymox
Apache License 2.0
7 stars 11 forks source link

Improper handling when mocking on instances #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

The attached script illustrates the problem.  

When you stub out a method on instance of a class and then unset the stub Mox 
leaves behind a copy of the method on the instance.  A future test which 
attempts to set the stub on a class will not affect the lingering instance.

Expected behavior:

When mox stubs out a method on an instance (or a subclass) which is not located 
on the object itself but in some parent object, it does not leave behind a copy 
of the mocked "thing" on the mocked object.

What version of the product are you using? On what operating system?

Mox 0.5.3-3 on Debian

Original issue reported on code.google.com by mgius7...@gmail.com on 13 Nov 2013 at 6:58

Attachments: