(self)
| 311 | |
| 312 | class TestOptimizedCompares(unittest.TestCase): |
| 313 | def test_safe_object_compare(self): |
| 314 | heterogeneous_lists = [[0, 'foo'], |
| 315 | [0.0, 'foo'], |
| 316 | [('foo',), 'foo']] |
| 317 | for L in heterogeneous_lists: |
| 318 | self.assertRaises(TypeError, L.sort) |
| 319 | self.assertRaises(TypeError, [(x,) for x in L].sort) |
| 320 | self.assertRaises(TypeError, [((x,),) for x in L].sort) |
| 321 | |
| 322 | float_int_lists = [[1,1.1], |
| 323 | [1<<70,1.1], |
| 324 | [1.1,1], |
| 325 | [1.1,1<<70]] |
| 326 | for L in float_int_lists: |
| 327 | check_against_PyObject_RichCompareBool(self, L) |
| 328 | |
| 329 | def test_unsafe_object_compare(self): |
| 330 |
nothing calls this directly
no test coverage detected