mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-133017: Improve error message for invalid typecodes in multiprocessing.{Array,Value} (GH-133252)
This commit is contained in:
parent
2cd24ebfe9
commit
f52de8a937
3 changed files with 22 additions and 1 deletions
|
@ -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', [])
|
||||
#
|
||||
#
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue