diff options
Diffstat (limited to 'Lib/test/test_memoryview.py')
-rw-r--r-- | Lib/test/test_memoryview.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py index f14bafd..bc83247 100644 --- a/Lib/test/test_memoryview.py +++ b/Lib/test/test_memoryview.py @@ -10,6 +10,8 @@ import weakref import array from test import test_support import io +import copy +import pickle class AbstractMemoryTests: @@ -354,6 +356,19 @@ class BytesMemorySliceSliceTest(unittest.TestCase, #pass +class OtherTest(unittest.TestCase): + def test_copy(self): + m = memoryview(b'abc') + with self.assertRaises(TypeError): + copy.copy(m) + + def test_pickle(self): + m = memoryview(b'abc') + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + with self.assertRaises(TypeError): + pickle.dumps(m, proto) + + def test_main(): test_support.run_unittest(__name__) |