Am 06.02.10 12:48, schrieb Steven D'Aprano:
It seems that doctest doesn't discover or execute doctests in methods
which have been decorated.
Here is my test file:
# ==
class MyStaticMethod(object):
"""Emulate built-in staticmethod descriptor."""
def __init__(self, f):
se
On 2/6/2010 7:51 PM, Steven D'Aprano wrote:
I have found an existing report for this issue:
http://bugs.python.org/issue4037
The original poster's suggested fix was on the right track, but not
complete. I've added a patch which works according to my tests.
Since this report is currently unass
On Sat, 06 Feb 2010 14:39:00 -0500, Terry Reedy wrote:
> On 2/6/2010 6:48 AM, Steven D'Aprano wrote:
>> It seems that doctest doesn't discover or execute doctests in methods
>> which have been decorated [by method descriptors].
[...]
>> This looks like bug to me. Have I missed anything?
>
> I
On Sat, 06 Feb 2010 14:39:00 -0500, Terry Reedy wrote:
> On 2/6/2010 6:48 AM, Steven D'Aprano wrote:
>> It seems that doctest doesn't discover or execute doctests in methods
>> which have been decorated.
[...]
> Doctest has to scan the dict, so it does not see the attribute-lookup
> result.
Aha
On Sat, 06 Feb 2010 14:00:28 -0500, John Posner wrote:
> On 2/6/2010 6:48 AM, Steven D'Aprano wrote:
>> class MyStaticMethod(object):
>> """Emulate built-in staticmethod descriptor."""
>> def __init__(self, f):
>> self.f = f
>> def __get__(self, obj, objtype=None):
>>
On 2/6/2010 6:48 AM, Steven D'Aprano wrote:
It seems that doctest doesn't discover or execute doctests in methods
which have been decorated.
Here is my test file:
# ==
class MyStaticMethod(object):
"""Emulate built-in staticmethod descriptor."""
def __init__(self, f):
se
On 2/6/2010 6:48 AM, Steven D'Aprano wrote:
class MyStaticMethod(object):
"""Emulate built-in staticmethod descriptor."""
def __init__(self, f):
self.f = f
def __get__(self, obj, objtype=None):
return self.f
How about using a function, instead of a class, to imp
It seems that doctest doesn't discover or execute doctests in methods
which have been decorated.
Here is my test file:
# ==
class MyStaticMethod(object):
"""Emulate built-in staticmethod descriptor."""
def __init__(self, f):
self.f = f
def __get__(self, obj, objtype=None