diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-18 09:58:55 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-18 09:58:55 +0300 |
commit | d91e676fd58a25420a3dc8705472dc6bf9ca46e2 (patch) | |
tree | 6b59a2b47e11a56fc46a26e1016d36832fb00e26 /Lib | |
parent | 5d062d7ba34068bed20e8b7486f9973bfafcd203 (diff) | |
parent | 886a5f352fd64bcdc814dad292bbb37739a1cdd9 (diff) | |
download | cpython-git-d91e676fd58a25420a3dc8705472dc6bf9ca46e2.tar.gz |
Issue #27343: Fixed error message for conflicting initializers of ctypes.Structure.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ctypes/test/test_structures.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py index 736679f630..94a86ea6dd 100644 --- a/Lib/ctypes/test/test_structures.py +++ b/Lib/ctypes/test/test_structures.py @@ -227,10 +227,10 @@ class StructureTestCase(unittest.TestCase): def test_conflicting_initializers(self): class POINT(Structure): - _fields_ = [("x", c_int), ("y", c_int)] + _fields_ = [("phi", c_float), ("rho", c_float)] # conflicting positional and keyword args - self.assertRaises(TypeError, POINT, 2, 3, x=4) - self.assertRaises(TypeError, POINT, 2, 3, y=4) + self.assertRaisesRegex(TypeError, "phi", POINT, 2, 3, phi=4) + self.assertRaisesRegex(TypeError, "rho", POINT, 2, 3, rho=4) # too many initializers self.assertRaises(TypeError, POINT, 2, 3, 4) |