summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryview.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-01 21:17:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-01 21:17:34 (GMT)
commit9cf85f144e73a1b1566e536436c066cfab32dac8 (patch)
tree45fa67e0eff68a7d0ef456237c4f12200e16c95e /Lib/test/test_memoryview.py
parent54f824f09268ed2475747fbfe810314420b150f7 (diff)
downloadcpython-9cf85f144e73a1b1566e536436c066cfab32dac8.zip
cpython-9cf85f144e73a1b1566e536436c066cfab32dac8.tar.gz
cpython-9cf85f144e73a1b1566e536436c066cfab32dac8.tar.bz2
Merged revisions 84408-84409 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84408 | antoine.pitrou | 2010-09-01 23:14:16 +0200 (mer., 01 sept. 2010) | 4 lines Issue #9737: Fix a crash when trying to delete a slice or an item from a memoryview object. ........ r84409 | antoine.pitrou | 2010-09-01 23:14:46 +0200 (mer., 01 sept. 2010) | 3 lines Fix a compilation warning ........
Diffstat (limited to 'Lib/test/test_memoryview.py')
-rw-r--r--Lib/test/test_memoryview.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py
index 2240740..611f57d 100644
--- a/Lib/test/test_memoryview.py
+++ b/Lib/test/test_memoryview.py
@@ -117,6 +117,15 @@ class AbstractMemoryTests:
m = None
self.assertEquals(sys.getrefcount(b), oldrefcount)
+ def test_delitem(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ with self.assertRaises(TypeError):
+ del m[1]
+ with self.assertRaises(TypeError):
+ del m[1:4]
+
def test_tobytes(self):
for tp in self._types:
m = self._view(tp(self._source))