[pypy-svn] pypy default: Add a custom version of string_tests with a custom hack for 'abc'.__mul__().

arigo commits-noreply at bitbucket.org
Fri Jan 21 13:40:44 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41127:7bd5f688338c
Date: 2011-01-21 13:40 +0100
http://bitbucket.org/pypy/pypy/changeset/7bd5f688338c/

Log:	Add a custom version of string_tests with a custom hack for
	'abc'.__mul__().

diff --git a/lib-python/2.7.0/test/string_tests.py b/lib-python/modified-2.7.0/test/string_tests.py
copy from lib-python/2.7.0/test/string_tests.py
copy to lib-python/modified-2.7.0/test/string_tests.py
--- a/lib-python/2.7.0/test/string_tests.py
+++ b/lib-python/modified-2.7.0/test/string_tests.py
@@ -1024,7 +1024,10 @@
         self.checkequal('abc', 'abc', '__mul__', 1)
         self.checkequal('abcabcabc', 'abc', '__mul__', 3)
         self.checkraises(TypeError, 'abc', '__mul__')
-        self.checkraises(TypeError, 'abc', '__mul__', '')
+        class Mul(object):
+            def mul(self, a, b):
+                return a * b
+        self.checkraises(TypeError, Mul(), 'mul', 'abc', '')
         # XXX: on a 64-bit system, this doesn't raise an overflow error,
         # but either raises a MemoryError, or succeeds (if you have 54TiB)
         #self.checkraises(OverflowError, 10000*'abc', '__mul__', 2000000000)


More information about the Pypy-commit mailing list