Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r58831:40d63bc4586f
Date: 2012-11-11 22:19 +0100
http://bitbucket.org/pypy/pypy/changeset/40d63bc4586f/
Log: test_array.py: Apply 2.7 changes to 3.2
diff --git a/lib-python/3.2/test/test_array.py
b/lib-python/3.2/test/test_array.py
--- a/lib-python/3.2/test/test_array.py
+++ b/lib-python/3.2/test/test_array.py
@@ -459,9 +459,10 @@
)
b = array.array(self.badtypecode())
- self.assertRaises(TypeError, a.__add__, b)
-
- self.assertRaises(TypeError, a.__add__, "bad")
+ with self.assertRaises(TypeError):
+ a + b
+ with self.assertRaises(TypeError):
+ a + 'bad'
def test_iadd(self):
a = array.array(self.typecode, self.example[::-1])
@@ -480,9 +481,10 @@
)
b = array.array(self.badtypecode())
- self.assertRaises(TypeError, a.__add__, b)
-
- self.assertRaises(TypeError, a.__iadd__, "bad")
+ with self.assertRaises(TypeError):
+ a += b
+ with self.assertRaises(TypeError):
+ a += 'bad'
def test_mul(self):
a = 5*array.array(self.typecode, self.example)
@@ -515,7 +517,8 @@
array.array(self.typecode, [a[0]] * 5)
)
- self.assertRaises(TypeError, a.__mul__, "bad")
+ with self.assertRaises(TypeError):
+ a * 'bad'
def test_imul(self):
a = array.array(self.typecode, self.example)
@@ -544,7 +547,8 @@
a *= -1
self.assertEqual(a, array.array(self.typecode))
- self.assertRaises(TypeError, a.__imul__, "bad")
+ with self.assertRaises(TypeError):
+ a *= 'bad'
def test_getitem(self):
a = array.array(self.typecode, self.example)
@@ -966,6 +970,7 @@
p = weakref.proxy(s)
self.assertEqual(p.tobytes(), s.tobytes())
s = None
+ support.gc_collect()
self.assertRaises(ReferenceError, len, p)
def test_bug_782369(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit