aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-05-09 10:46:45 +0200
committerGitHub <noreply@github.com>2025-05-09 11:46:45 +0300
commitf52de8a937e89a4d1cf314f12ee5e7bbaa79e7da (patch)
treeca7e2ed1c01b260b10ee895af588b2276d4ee282 /Lib/test/_test_multiprocessing.py
parent2cd24ebfe9a14bd52cb4d411c126b6a2dac65ae0 (diff)
downloadcpython-f52de8a937e89a4d1cf314f12ee5e7bbaa79e7da.tar.gz
cpython-f52de8a937e89a4d1cf314f12ee5e7bbaa79e7da.zip
gh-133017: Improve error message for invalid typecodes in multiprocessing.{Array,Value} (GH-133252)
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 4dc9a31d22f..1b690cb88bf 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2463,6 +2463,12 @@ class _TestValue(BaseTestCase):
self.assertNotHasAttr(arr5, 'get_lock')
self.assertNotHasAttr(arr5, 'get_obj')
+ @unittest.skipIf(c_int is None, "requires _ctypes")
+ def test_invalid_typecode(self):
+ with self.assertRaisesRegex(TypeError, 'bad typecode'):
+ self.Value('x', None)
+ with self.assertRaisesRegex(TypeError, 'bad typecode'):
+ self.RawValue('x', None)
class _TestArray(BaseTestCase):
@@ -2543,6 +2549,12 @@ class _TestArray(BaseTestCase):
self.assertNotHasAttr(arr5, 'get_lock')
self.assertNotHasAttr(arr5, 'get_obj')
+ @unittest.skipIf(c_int is None, "requires _ctypes")
+ def test_invalid_typecode(self):
+ with self.assertRaisesRegex(TypeError, 'bad typecode'):
+ self.Array('x', [])
+ with self.assertRaisesRegex(TypeError, 'bad typecode'):
+ self.RawArray('x', [])
#
#
#