]> granicus.if.org Git - python/commitdiff
Add a small test to verify that member and getset descriptors now have
authorGuido van Rossum <guido@python.org>
Thu, 20 Sep 2001 21:49:53 +0000 (21:49 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 20 Sep 2001 21:49:53 +0000 (21:49 +0000)
docstrings (using file.closed and file.name as examples).

Lib/test/test_descr.py

index fab1e66dadb7034d61bfd1d228ef9f64816b232b..426b2d4b0e05770f4ab8f9e337294c4d9ff79cd3 100644 (file)
@@ -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__":