summaryrefslogtreecommitdiff
path: root/Lib/test/test_tuple.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_tuple.py')
-rw-r--r--Lib/test/test_tuple.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index 51875a1cbd..d711116e37 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
@@ -203,6 +208,14 @@ class TupleTest(seq_tests.CommonTest):
with self.assertRaises(TypeError):
[3,] + T((1,2))
+ def test_lexicographic_ordering(self):
+ # Issue 21100
+ a = self.type2test([1, 2])
+ b = self.type2test([1, 2, 0])
+ c = self.type2test([1, 3])
+ self.assertLess(a, b)
+ self.assertLess(b, c)
+
def test_main():
support.run_unittest(TupleTest)