Filip Zyzniewski added the comment:
It seems like there is also an issue with property classes defined in a
different module.
In the example below Foo.x uses standard property, and Foo.y uses prop imported
from the prop module.
This results in docstring for Foo.y to be missed:
filip@klocek:~/test$ cat prop.py
class prop(property):
pass
filip@klocek:~/test$ cat foo.py
from prop import prop
class Foo(object):
@property
def x(self):
"""
>>> Foo().x
'x'
"""
return 'x'
@prop
def y(self):
"""
>>> Foo().y
'y'
"""
return 'y'
filip@klocek:~/test$ python --version
Python 2.7.3
filip@klocek:~/test$ python -m doctest foo.py -v
Trying:
Foo().x
Expecting:
'x'
ok
2 items had no tests:
foo
foo.Foo
1 items passed all tests:
1 tests in foo.Foo.x
1 tests in 3 items.
1 passed and 0 failed.
Test passed.
filip@klocek:~/test$ python3 --version
Python 3.2.3
filip@klocek:~/test$ python3 -m doctest foo.py -v
Trying:
Foo().x
Expecting:
'x'
ok
2 items had no tests:
foo
foo.Foo
1 items passed all tests:
1 tests in foo.Foo.x
1 tests in 3 items.
1 passed and 0 failed.
Test passed.
filip@klocek:~/test$
----------
nosy: +filip.zyzniewski
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4037>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com