LEFT | RIGHT |
1 """Tests for binary operators on subtypes of built-in types.""" | 1 """Tests for binary operators on subtypes of built-in types.""" |
2 | 2 |
3 import unittest | 3 import unittest |
4 from test import support | 4 from test import support |
5 from operator import eq, le | 5 from operator import eq, le, ne |
6 from abc import ABCMeta | 6 from abc import ABCMeta |
7 | 7 |
8 def gcd(a, b): | 8 def gcd(a, b): |
9 """Greatest common divisor using Euclid's algorithm.""" | 9 """Greatest common divisor using Euclid's algorithm.""" |
10 while a: | 10 while a: |
11 a, b = b%a, a | 11 a, b = b%a, a |
12 return b | 12 return b |
13 | 13 |
14 def isint(x): | 14 def isint(x): |
15 """Test whether an object is an instance of int.""" | 15 """Test whether an object is an instance of int.""" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 def test_fallback_ne_blocking(self): | 432 def test_fallback_ne_blocking(self): |
433 e, sn, xn = SupEq(), SN(), XN() | 433 e, sn, xn = SupEq(), SN(), XN() |
434 self.assertFalse(e != e) | 434 self.assertFalse(e != e) |
435 self.assertRaises(TypeError, ne, e, sn) | 435 self.assertRaises(TypeError, ne, e, sn) |
436 self.assertRaises(TypeError, ne, sn, e) | 436 self.assertRaises(TypeError, ne, sn, e) |
437 self.assertFalse(e != xn) | 437 self.assertFalse(e != xn) |
438 self.assertRaises(TypeError, ne, xn, e) | 438 self.assertRaises(TypeError, ne, xn, e) |
439 | 439 |
440 if __name__ == "__main__": | 440 if __name__ == "__main__": |
441 unittest.main() | 441 unittest.main() |
LEFT | RIGHT |