From: Stefan Krah Date: Tue, 6 Nov 2012 22:27:24 +0000 (+0100) Subject: Backport fc8f1b1c76bf. X-Git-Tag: v3.3.1rc1~673 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c3fb3c3fa0688327d31715cb374c6825158f9d75;p=thirdparty%2FPython%2Fcpython.git Backport fc8f1b1c76bf. --- diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py index 977b282d636d..747e2a287ee2 100644 --- a/Lib/test/test_buffer.py +++ b/Lib/test/test_buffer.py @@ -4001,23 +4001,13 @@ class TestBufferProtocol(unittest.TestCase): # equality-hash invariant x = ndarray(list(range(12)), shape=[12], format='B') - a = memoryview(nd) + a = memoryview(x) y = ndarray(list(range(12)), shape=[12], format='b') - b = memoryview(nd) + b = memoryview(y) - z = ndarray(list(bytes(chr(x), 'latin-1') for x in range(12)), - shape=[12], format='c') - c = memoryview(nd) - - if (a == b): - self.assertEqual(hash(a), hash(b)) - - if (a == c): - self.assertEqual(hash(a), hash(c)) - - if (b == c): - self.assertEqual(hash(b), hash(c)) + self.assertEqual(a, b) + self.assertEqual(hash(a), hash(b)) # non-byte formats nd = ndarray(list(range(12)), shape=[2,2,3], format='L')