[pypy-svn] r7771 - pypy/trunk/src/pypy/objspace/test

arigo at codespeak.net arigo at codespeak.net
Tue Dec 7 17:05:41 CET 2004


Author: arigo
Date: Tue Dec  7 17:05:40 2004
New Revision: 7771

Modified:
   pypy/trunk/src/pypy/objspace/test/test_descriptor.py
Log:
a new test...

Modified: pypy/trunk/src/pypy/objspace/test/test_descriptor.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/test/test_descriptor.py	(original)
+++ pypy/trunk/src/pypy/objspace/test/test_descriptor.py	Tue Dec  7 17:05:40 2004
@@ -1,7 +1,18 @@
 import autopath
 from pypy.tool import testit
     
-class Test_TraceObjSpace(testit.AppTestCase):
+class Test_Descriptor(testit.AppTestCase):
+
+    def test_non_data_descr(self):
+        class X(object):
+            def f(self):
+                return 42
+        x = X()
+        self.assertEquals(x.f(), 42)
+        x.f = 43
+        self.assertEquals(x.f, 43)
+        del x.f
+        self.assertEquals(x.f(), 42)
 
     def test_member(self):
         import sys



More information about the Pypy-commit mailing list