Commit 15e14538 authored by Serhiy Storchaka's avatar Serhiy Storchaka Committed by GitHub

Fix a test for select.kevent. (#4349)

select.kevent objects are now comparable with other objects in Python 2.
parent 2ce1ef54
......@@ -36,9 +36,12 @@ class TestKQueue(unittest.TestCase):
self.assertEqual(cmp(ev, other), -1)
self.assertTrue(ev < other)
self.assertTrue(other >= ev)
self.assertRaises(TypeError, cmp, ev, None)
self.assertRaises(TypeError, cmp, ev, 1)
self.assertRaises(TypeError, cmp, ev, "ev")
self.assertNotEqual(cmp(ev, None), 0)
self.assertNotEqual(cmp(ev, 1), 0)
self.assertNotEqual(cmp(ev, "ev"), 0)
self.assertEqual(cmp(ev, None), -cmp(None, ev))
self.assertEqual(cmp(ev, 1), -cmp(1, ev))
self.assertEqual(cmp(ev, "ev"), -cmp("ev", ev))
ev = select.kevent(fd, select.KQ_FILTER_WRITE)
self.assertEqual(ev.ident, fd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment