Steven D'Aprano <st...@pearwood.info> wrote: > > The reason I ask is because I've just spent the weekend battling with > doctests of decorated functions, and discovering that without > functools.wraps() all my doctests weren't being called. I'm wondering > whether it would be a good idea for doctest to auto-detect tests in > closures. > > This is not needed if you call wraps() appropriately, but you might not > always do that. >
I don't think it is a good idea to call the wrapped doctests automatically, but I do think it might be a good idea to detect and warn about anything which looks like it is a wrapper where the wrapped function includes a doctest and the wrapper doesn't. -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list