[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.66,1.67

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 20 Sep 2001 14:49:55 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv7022

Modified Files:
	test_descr.py 
Log Message:
Add a small test to verify that member and getset descriptors now have
docstrings (using file.closed and file.name as examples).


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** test_descr.py	2001/09/20 21:39:07	1.66
--- test_descr.py	2001/09/20 21:49:53	1.67
***************
*** 1952,1956 ****
--- 1952,1963 ----
      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()
***************
*** 1993,1996 ****
--- 2000,2004 ----
      rich_comparisons()
      coercions()
+     descrdoc()
      if verbose: print "All OK"