summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-18 06:58:24 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-18 06:58:24 (GMT)
commit886a5f352fd64bcdc814dad292bbb37739a1cdd9 (patch)
tree54492f7a1066712a3ec190204170b80a11e9d083 /Lib
parent08bb8a41cc976343795bd0e241cd7388e9f44ad5 (diff)
downloadcpython-886a5f352fd64bcdc814dad292bbb37739a1cdd9.zip
cpython-886a5f352fd64bcdc814dad292bbb37739a1cdd9.tar.gz
cpython-886a5f352fd64bcdc814dad292bbb37739a1cdd9.tar.bz2
Issue #27343: Fixed error message for conflicting initializers of ctypes.Structure.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_structures.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index 84d456c..d998c27 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)