[Python-checkins] python/dist/src/Lib/test test_weakref.py,1.17,1.18

fdrake@sourceforge.net fdrake@sourceforge.net
Wed, 10 Apr 2002 20:59:47 -0700


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

Modified Files:
	test_weakref.py 
Log Message:
Improve coverage of Objects/weakrefobject.c.

Index: test_weakref.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** test_weakref.py	19 Dec 2001 16:54:23 -0000	1.17
--- test_weakref.py	11 Apr 2002 03:59:42 -0000	1.18
***************
*** 47,50 ****
--- 47,59 ----
          self.check_basic_ref(create_unbound_method)
  
+         # Just make sure the tp_repr handler doesn't raise an exception.
+         # Live reference:
+         o = C()
+         wr = weakref.ref(o)
+         `wr`
+         # Dead reference:
+         del o
+         `wr`
+ 
      def test_basic_callback(self):
          self.check_basic_callback(C)
***************
*** 167,170 ****
--- 176,186 ----
          p2 = weakref.proxy(L2)
          self.assertEqual(p, p2)
+         ## self.assertEqual(`L2`, `p2`)
+         L3 = UserList.UserList(range(10))
+         p3 = weakref.proxy(L3)
+         self.assertEqual(L3[:], p3[:])
+         self.assertEqual(L3[5:], p3[5:])
+         self.assertEqual(L3[:5], p3[:5])
+         self.assertEqual(L3[2:5], p3[2:5])
  
      def test_callable_proxy(self):