You mentioned that changing this setting seemed to have no effect.  Did you manage to figure out why?

`run_wrapped` is a strange way to do this.  The more conventional way is to use `mock.patch.dict`: http://www.voidspace.org.uk/python/mock/patch.html#patch-dict

This does essentially the same thing: it adds or modifies a value in a dictionary, then reverts the changes.  The linked docs explain how to use this as a context manager (using the Python `with` keyword).