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

(cherry picked from commit c0cd790219)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-08-01 09:29:57 -07:00 committed by GitHub
parent 3192fd7683
commit 76d83b1dfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -378,6 +378,12 @@ class TestOptimizedCompares(unittest.TestCase):
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__":