doctest fails to see tests in decorated functions

Steven D'Aprano steve at pearwood.info
Sun Feb 15 00:31:37 EST 2009


Steven D'Aprano wrote:

> I've just spotted a bug in doctest that it fails to see tests inside
> decorated functions. It's been reported before:
> 
> http://bugs.python.org/issue1108
> 
> but the patch submitted doesn't work for me.

Never mind, it was a PEBCAK error. I failed to notice that applying a
decorator to a function shadows the functions docstring.

Normally I would use functools.wraps, but I am currently limping along on a
Python 2.4 installation here, which doesn't have it.


-- 
Steven




More information about the Python-list mailing list