]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport gvanrossum's checkin of
authorMichael W. Hudson <mwh@python.net>
Thu, 14 Mar 2002 17:16:27 +0000 (17:16 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 14 Mar 2002 17:16:27 +0000 (17:16 +0000)
    revision 1.118 of test_descr.py

Add a check that SF bug 516727 is really fixed.

Lib/test/test_descr.py

index 696e99c92790571e65bb52dab4eeb5a4b3d5b65f..32940eb9ebd35cc63f16d19c482ec05ba659f35b 100644 (file)
@@ -429,6 +429,16 @@ def ints():
     # The following crashes in Python 2.2
     vereq((1).__nonzero__(), 1)
     vereq((0).__nonzero__(), 0)
+    # This returns 'NotImplemented' in Python 2.2
+    class C(int):
+        def __add__(self, other):
+            return NotImplemented
+    try:
+        C() + ""
+    except TypeError:
+        pass
+    else:
+        raise TestFailed, "NotImplemented should have caused TypeErrpr"
 
 def longs():
     if verbose: print "Testing long operations..."