From: Michael W. Hudson Date: Thu, 14 Mar 2002 17:16:27 +0000 (+0000) Subject: backport gvanrossum's checkin of X-Git-Tag: v2.2.1c1~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d82ae99170d685968d79fbe00d86f8177660f25f;p=thirdparty%2FPython%2Fcpython.git backport gvanrossum's checkin of revision 1.118 of test_descr.py Add a check that SF bug 516727 is really fixed. --- diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 696e99c92790..32940eb9ebd3 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -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..."