mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Add a small test to verify that member and getset descriptors now have
docstrings (using file.closed and file.name as examples).
This commit is contained in:
parent
32d34c809f
commit
8b9cc7e69e
1 changed files with 8 additions and 0 deletions
|
|
@ -1951,6 +1951,13 @@ def coercions():
|
|||
coerce(0., C(0))
|
||||
coerce(0j, C(0))
|
||||
|
||||
def descrdoc():
|
||||
if verbose: print "Testing descriptor doc strings..."
|
||||
def check(descr, what):
|
||||
verify(descr.__doc__ == what, repr(descr.__doc__))
|
||||
check(file.closed, "flag set if the file is closed") # getset descriptor
|
||||
check(file.name, "file name") # member descriptor
|
||||
|
||||
|
||||
def test_main():
|
||||
lists()
|
||||
|
|
@ -1992,6 +1999,7 @@ def test_main():
|
|||
classic_comparisons()
|
||||
rich_comparisons()
|
||||
coercions()
|
||||
descrdoc()
|
||||
if verbose: print "All OK"
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue