summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_buffer.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-11-06 22:27:24 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-11-06 22:27:24 (GMT)
commitc3fb3c3fa0688327d31715cb374c6825158f9d75 (patch)
tree15a445cda7200afb37761d5a89114fc249d7bcf8 /Lib/test/test_buffer.py
parent99bafff7cc66c0d79b2c5bec13656c098807623d (diff)
downloadcpython-c3fb3c3fa0688327d31715cb374c6825158f9d75.zip
cpython-c3fb3c3fa0688327d31715cb374c6825158f9d75.tar.gz
cpython-c3fb3c3fa0688327d31715cb374c6825158f9d75.tar.bz2
Backport fc8f1b1c76bf.
Diffstat (limited to 'Lib/test/test_buffer.py')
-rw-r--r--Lib/test/test_buffer.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 977b282..747e2a2 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')