gh-95173: Add a regression test for sorting tuples containing None (#95464)

This commit is contained in:
Jacob Walls 2022-08-01 12:02:09 -04:00 committed by GitHub
parent 7d8973870b
commit c0cd790219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -378,6 +378,12 @@ def test_not_all_tuples(self):
self.assertRaises(TypeError, [(1.0, 1.0), (False, "A"), 6].sort)
self.assertRaises(TypeError, [('a', 1), (1, 'a')].sort)
self.assertRaises(TypeError, [(1, 'a'), ('a', 1)].sort)
def test_none_in_tuples(self):
expected = [(None, 1), (None, 2)]
actual = sorted([(None, 2), (None, 1)])
self.assertEqual(actual, expected)
#==============================================================================
if __name__ == "__main__":