1 from test
.test_support
import run_unittest
, check_py3k_warnings
4 class TestImplementationComparisons(unittest
.TestCase
):
6 def test_type_comparisons(self
):
7 self
.assertTrue(str < int or str > int)
8 self
.assertTrue(int <= str or int >= str)
9 self
.assertTrue(cmp(int, str) != 0)
10 self
.assertTrue(int is int)
11 self
.assertTrue(str == str)
12 self
.assertTrue(int != str)
14 def test_cell_comparisons(self
):
24 g_cell
, = g
.func_closure
25 h_cell
, = h
.func_closure
26 self
.assertTrue(h_cell
< g_cell
)
27 self
.assertTrue(g_cell
>= h_cell
)
28 self
.assertEqual(cmp(g_cell
, h_cell
), 1)
29 self
.assertTrue(g_cell
is g_cell
)
30 self
.assertTrue(g_cell
== g_cell
)
31 self
.assertTrue(h_cell
== h_cell
)
32 self
.assertTrue(g_cell
!= h_cell
)
35 with
check_py3k_warnings():
36 run_unittest(TestImplementationComparisons
)
38 if __name__
== '__main__':