From a32dedd16c8998faad1aa7cd31f57de4d4e5ecee Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 29 Jun 2001 20:30:58 +0000 Subject: [PATCH] updates for Python2.1 [SVN r10485] --- test/comprehensive.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/comprehensive.py b/test/comprehensive.py index 06a191af..013fae96 100644 --- a/test/comprehensive.py +++ b/test/comprehensive.py @@ -19,10 +19,13 @@ Load up the extension module Automatic checking of the number and type of arguments. Foo's constructor takes a single long parameter. - >>> ext = Foo() - Traceback (innermost last): - File "", line 1, in ? - TypeError: function requires exactly 1 argument; 0 given + >>> try: + ... ext = Foo() + ... except TypeError, err: + ... assert re.match(r'function .* exactly 1 argument;? \(?0 given\)?', + ... str(err)) + ... else: + ... print 'no exception' >>> try: ext = Foo('foo') ... except TypeError, err: @@ -1014,9 +1017,12 @@ test inheritB2 -2 >>> str(i) '2' - >>> j = i/i - Traceback (innermost last): - TypeError: bad operand type(s) for / + >>> try: j = i/i + ... except TypeError, err: + ... assert re.match(r'(bad|unsupported) operand type\(s\) for /', + ... str(err)) + ... else: print 'no exception' + >>> j = abs(i) Traceback (innermost last): TypeError: bad operand type for abs()