diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-08-02 05:30:37 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-08-02 05:30:37 (GMT) |
commit | ffff1440d118cae189a6c2baf595dda52cdc7c3a (patch) | |
tree | e1664353a0276044933c16879fa59e7521a6044e /Lib/test/test_tuple.py | |
parent | 7f9cc9359bdbcc877b2a6f976c8e8bdbc714ce90 (diff) | |
download | cpython-ffff1440d118cae189a6c2baf595dda52cdc7c3a.zip cpython-ffff1440d118cae189a6c2baf595dda52cdc7c3a.tar.gz cpython-ffff1440d118cae189a6c2baf595dda52cdc7c3a.tar.bz2 |
Issue #22077: Improve index error messages for bytearrays, bytes, lists, and
tuples by adding 'or slices'. Added ', not <typename' for bytearrays.
Original patch by Claudiu Popa.
Diffstat (limited to 'Lib/test/test_tuple.py')
-rw-r--r-- | Lib/test/test_tuple.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py index 14c6430..0b19ea4 100644 --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -6,6 +6,11 @@ import pickle class TupleTest(seq_tests.CommonTest): type2test = tuple + def test_getitem_error(self): + msg = "tuple indices must be integers or slices" + with self.assertRaisesRegex(TypeError, msg): + ()['a'] + def test_constructors(self): super().test_constructors() # calling built-in types without argument must return empty |