Ronny Pfannschmidt  committed f096e9a

add a array sequence equal function, ew

  • Participants
  • Parent commits 0185ba7

Comments (0)

Files changed (1)


    Roger E. Masse
+import sys
 import unittest
 from test import test_support
 from weakref import proxy
 tests = [] # list to accumulate all tests
 typecodes = "cubBhHiIlLfd"
+skip_on_cpython = unittest.skipIf("__pypy__" in sys.modules, 'does not work on cpython')
 class BadConstructorTest(unittest.TestCase):
     def test_constructor(self):
     def assertEntryEqual(self, entry1, entry2):
         self.assertEqual(entry1, entry2)
+    def __init__(self, *k, **kw):
+        super(BaseTest, self).__init__(*k, **kw)
+        self.addTypeEqualityFunc(array.array, 'assertArrayEqual')
+    def assertArrayEqual(self, array1, array2, msg=None):
+        self.assertSequenceEqual(array1, array2, msg, seq_type=array.array)
     def badtypecode(self):
         # Return a typecode that is different from our own
         return typecodes[(typecodes.index(self.typecode)+1) % len(typecodes)]
+    @skip_on_cpython
     def test_buffer(self):
         a = array.array(self.typecode, self.example)
         with test_support.check_py3k_warnings():