Eric Snow schrieb: > Apparently there is a known issue with doctests, in which tests in > functions using externally defined decorators are ignored. The > recommended fix is to update the order of checks in the _from_module > method of DocTestFinder in the doctest module. The bug and fix are > discussed at the following URLs (and several places in this group): > > http://bugs.python.org/issue1108 > http://mail.python.org/pipermail/python-list/2007-September/627866.html > > The fix implies that the inpect.getmodule function will find the > module of the function object and not of the decorator. However, in > 2.4 the inspect.getmodule function returns the module of the > decorator. I have subsequently tested this in 2.5 and 2.6, and it > also returns the module of the decorator. As such, the fix for > doctests does not work in my tests. Below is the test code that I > used:
It's not an issue with the doctest module but with your code. You want to use functools.wraps(). http://docs.python.org/library/functools.html#functools.wraps Christian -- http://mail.python.org/mailman/listinfo/python-list