diff options
Diffstat (limited to 'Lib/test/test_collections.py')
| -rw-r--r-- | Lib/test/test_collections.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index c17b76d..dd9982a 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -55,6 +55,13 @@ class TestNamedTuple(unittest.TestCase): self.assertEqual(p._replace(x=1), (1, 22)) # test _replace method self.assertEqual(p._asdict(), dict(x=11, y=22)) # test _asdict method + try: + p._replace(x=1, error=2) + except ValueError: + pass + else: + self._fail('Did not detect an incorrect fieldname') + # verify that field string can have commas Point = namedtuple('Point', 'x, y') p = Point(x=11, y=22) |
