diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2011-03-26 10:21:20 +0000 |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2011-03-26 10:21:20 +0000 |
commit | 633872e3fbfba101dcae0fb1d6938c91e10adafe (patch) | |
tree | e1e69d6639542333dac9d3f08d70fae2c5b39383 /Lib/test/test_multiprocessing.py | |
parent | 01606dea3d75faf73e507c7b200a42897338d44b (diff) | |
parent | 89461ef8fcc87996791a383f1973542a3487ce4f (diff) | |
download | cpython-git-633872e3fbfba101dcae0fb1d6938c91e10adafe.tar.gz |
Merge #11675
Diffstat (limited to 'Lib/test/test_multiprocessing.py')
-rw-r--r-- | Lib/test/test_multiprocessing.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 55b8cdd4c9..4e48944f70 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -917,6 +917,21 @@ class _TestArray(BaseTestCase): self.assertEqual(list(arr[:]), seq) @unittest.skipIf(c_int is None, "requires _ctypes") + def test_array_from_size(self): + size = 10 + # Test for zeroing (see issue #11675). + # The repetition below strengthens the test by increasing the chances + # of previously allocated non-zero memory being used for the new array + # on the 2nd and 3rd loops. + for _ in range(3): + arr = self.Array('i', size) + self.assertEqual(len(arr), size) + self.assertEqual(list(arr), [0] * size) + arr[:] = range(10) + self.assertEqual(list(arr), list(range(10))) + del arr + + @unittest.skipIf(c_int is None, "requires _ctypes") def test_rawarray(self): self.test_array(raw=True) |