Re: doctests and decorators

2009-06-16 Thread Steven D'Aprano
On Tue, 16 Jun 2009 12:04:32 -0700, Scott David Daniels wrote: > Eric Snow wrote: >> In general should decorators always hide themselves? I am guessing >> not, otherwise this would already be part of their behavior. Still, is >> it the common case to camouflage the decorator like this? If so, I

Re: doctests and decorators

2009-06-16 Thread Scott David Daniels
Eric Snow wrote: In general should decorators always hide themselves? I am guessing not, otherwise this would already be part of their behavior. Still, is it the common case to camouflage the decorator like this? If so, I would expect it to be the default behavior of decorators. The Python g

Re: doctests and decorators

2009-06-16 Thread Scott David Daniels
Eric Snow wrote: ... One work-around I found is the following change in example: test1.py def decorator(function): def new_function(*args, **kwargs): return function(*args, **kwargs) new_function.__module__ = function.__module__ new_function.__doc_

Re: doctests and decorators

2009-06-16 Thread Eric Snow
On Jun 16, 11:24 am, Michele Simionato wrote: > On Jun 16, 6:39 pm, Eric Snow wrote: > > > > > On Jun 16, 10:31 am, Christian Heimes wrote: > > > > Eric Snow schrieb: > > > > > Apparently there is a known issue with doctests, in which tests in > > > > functions using externally defined decorator

Re: doctests and decorators

2009-06-16 Thread Michele Simionato
On Jun 16, 6:39 pm, Eric Snow wrote: > On Jun 16, 10:31 am, Christian Heimes wrote: > > > > > 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

Re: doctests and decorators

2009-06-16 Thread Eric Snow
On Jun 16, 10:31 am, Christian Heimes wrote: > 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

Re: doctests and decorators

2009-06-16 Thread Christian Heimes
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 > di

Re: doctests and decorators

2009-06-16 Thread Eric Snow
On Jun 16, 9:59 am, Eric Snow wrote: > 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 b

doctests and decorators

2009-06-16 Thread Eric Snow
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