(self)
| 246 | self.unop_test(a, res, expr, name) |
| 247 | |
| 248 | def test_ints(self): |
| 249 | # Testing int operations... |
| 250 | self.number_operators(100, 3) |
| 251 | # The following crashes in Python 2.2 |
| 252 | self.assertEqual((1).__bool__(), 1) |
| 253 | self.assertEqual((0).__bool__(), 0) |
| 254 | # This returns 'NotImplemented' in Python 2.2 |
| 255 | class C(int): |
| 256 | def __add__(self, other): |
| 257 | return NotImplemented |
| 258 | self.assertEqual(C(5), 5) |
| 259 | try: |
| 260 | C() + "" |
| 261 | except TypeError: |
| 262 | pass |
| 263 | else: |
| 264 | self.fail("NotImplemented should have caused TypeError") |
| 265 | |
| 266 | def test_floats(self): |
| 267 | # Testing float operations... |
nothing calls this directly
no test coverage detected