MCPcopy Index your code
hub / github.com/python/cpython / test_unsafe_tuple_compare

Method test_unsafe_tuple_compare

Lib/test/test_sort.py:386–396  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

384 x in range(100)])
385
386 def test_unsafe_tuple_compare(self):
387 # This test was suggested by Tim Peters. It verifies that the tuple
388 # comparison respects the current tuple compare semantics, which do not
389 # guarantee that x < x <=> (x,) < (x,)
390 #
391 # Note that we don't have to put anything in tuples here, because
392 # the check function does a tuple test automatically.
393
394 check_against_PyObject_RichCompareBool(self, [float('nan')]*100)
395 check_against_PyObject_RichCompareBool(self, [float('nan') for
396 _ in range(100)])
397
398 def test_not_all_tuples(self):
399 self.assertRaises(TypeError, [(1.0, 1.0), (False, "A"), 6].sort)

Callers

nothing calls this directly

Tested by

no test coverage detected