mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-110275: Named tuple's __replace__() now raises TypeError for invalid arguments (GH-110299)
This commit is contained in:
parent
da6760bdf5
commit
c74e9fb189
5 changed files with 9 additions and 7 deletions
|
@ -952,7 +952,7 @@ class TestReplace(unittest.TestCase):
|
|||
self.assertEqual(copy.replace(p, x=1), (1, 22))
|
||||
self.assertEqual(copy.replace(p, y=2), (11, 2))
|
||||
self.assertEqual(copy.replace(p, x=1, y=2), (1, 2))
|
||||
with self.assertRaisesRegex(ValueError, 'unexpected field name'):
|
||||
with self.assertRaisesRegex(TypeError, 'unexpected field name'):
|
||||
copy.replace(p, x=1, error=2)
|
||||
|
||||
def test_dataclass(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue