doctest and decorators

Daniel Larsson daniel.j.larsson at gmail.com
Tue Sep 4 16:29:58 EDT 2007


Hi,

I assume this is a FAQ, but I couldn't find much helpful information
googling. I'm having trouble with doctest skipping my functions, if I'm
using decorators (that are defined in a separate module). If I'm
understanding what is happening correctly, it's because doctest checks if
the function's func_global attribute is the same as the module's __dict__
attribute. The decorator in question returns a wrapping function, though, so
this check fails.

What are some solutions to this? I can define __test__, but it seems rather
cumbersome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070904/d0ab915f/attachment.html>


More information about the Python-list mailing list