diff options
author | Guido van Rossum <guido@python.org> | 2001-09-20 21:49:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-09-20 21:49:53 (GMT) |
commit | 8b9cc7e69e179a9178bf8183497c3734bfa589e0 (patch) | |
tree | 850036fbb4e3db15a40605778006668ed89f2d68 | |
parent | 32d34c809f5971f79462dcb7d0f536d46e624acc (diff) | |
download | cpython-8b9cc7e69e179a9178bf8183497c3734bfa589e0.zip cpython-8b9cc7e69e179a9178bf8183497c3734bfa589e0.tar.gz cpython-8b9cc7e69e179a9178bf8183497c3734bfa589e0.tar.bz2 |
Add a small test to verify that member and getset descriptors now have
docstrings (using file.closed and file.name as examples).
-rw-r--r-- | Lib/test/test_descr.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index fab1e66..426b2d4 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -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__": |