Export to GitHub

pymox - issue #57

Improper handling when mocking on instances


Posted on Nov 13, 2013 by Happy Hippo

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

Attachments

Status: New

Labels:
Type-Defect Priority-Medium