plone/plone.testing — comment on commit 2254545a37f03da23eefdc9c4f9c5771752750f6
File:  line 0
By vipod:

I can take a look into plone.app.linkintegrity, but this won't completely resolve the problem. I just found that PloneFormGen does similar get_module_info patch with (*args, **kwargs) arguments. So it'll cause the same issue.

For me it looks like patching code is doing it right using (*args, **kwargs)-like parameters, trying to stay valid for possible future updates to original get_module_info function. And the main problem is that python's default mutable arguments are not cleared between function calls.

I think that because plone.testing is trying to keep arguments clean, it should try to do it a bit better. Could it be possible to have it remember all default mutable values inside setUpApp and then re-store it in tearDownApp? Or would it be too complicated and excessive?