summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryview.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-06-23 20:38:54 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-06-23 20:38:54 (GMT)
commit159eac92c50d37abc1c324de8762130bb6d6164a (patch)
tree607092bab91c7aa7b3db09cde9f83cc6d5e2fdac /Lib/test/test_memoryview.py
parentb7706b58fae704458b090e3c5ce4eb7bd73091e3 (diff)
downloadcpython-159eac92c50d37abc1c324de8762130bb6d6164a.zip
cpython-159eac92c50d37abc1c324de8762130bb6d6164a.tar.gz
cpython-159eac92c50d37abc1c324de8762130bb6d6164a.tar.bz2
Issue 6329: Fix iteration for memoryviews.
Diffstat (limited to 'Lib/test/test_memoryview.py')
-rw-r--r--Lib/test/test_memoryview.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py
index cc8502b..31bfa62 100644
--- a/Lib/test/test_memoryview.py
+++ b/Lib/test/test_memoryview.py
@@ -48,6 +48,12 @@ class AbstractMemoryTests:
for tp in self._types:
self.check_getitem_with_type(tp)
+ def test_iter(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ self.assertEqual(list(m), [m[i] for i in range(len(m))])
+
def test_setitem_readonly(self):
if not self.ro_type:
return