[TIP] patch automatically functions in external library
jens.rantil at gmail.com
Tue Aug 21 14:58:52 PDT 2012
Since you seem to have receive any response at all I'll pitch in my 5 cents;
First off, pep8 states that "private" functions should be prepended with an
underscore. Using this style could make things like this much simpler - you
would only have to worry about public functions. But maybe you already do
That said, depending on Python version you are targetting you could use
importlib[1,2] to create your own module importer that wraps the real
module using Mock <http://www.voidspace.org.uk/python/mock/>, or similar.
On Mon, Aug 20, 2012 at 5:18 PM, andrea crotti <andrea.crotti.0 at gmail.com>wrote:
> I have one "common" project that contains a lot of code which is useful
> from more different projects.
> All projects have (hopefully) unit tests, but what I'm worried about now
> is that changing a function signature in *common* might make break
> something somewhere else.
> This is a common problem I guess, and I could use something like pylint
> But even better, if I'm able to
> - automatically mock every "common" import, using as a spec the real one
> - check that every function call has the right arguments
> it would be even better I think..
> Is that possible or is there another better way?
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
Want to know how full my inbox is? Or how to get in touch with me faster?
Or tell me your e-mail is not that important? Then check this out:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python