diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-01-27 18:17:45 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-01-27 18:17:45 (GMT) |
commit | a56c467ac39ab1a6a2e9dc2fa41a9f573f989839 (patch) | |
tree | f65fc7d2a4359328f10c1dd9122a692e78e71e8a /Lib/test/test_kqueue.py | |
parent | 191e850053128f726d6562e1d8306dfe5e4aa8aa (diff) | |
download | cpython-a56c467ac39ab1a6a2e9dc2fa41a9f573f989839.zip cpython-a56c467ac39ab1a6a2e9dc2fa41a9f573f989839.tar.gz cpython-a56c467ac39ab1a6a2e9dc2fa41a9f573f989839.tar.bz2 |
Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from
the standard library and tests.
Diffstat (limited to 'Lib/test/test_kqueue.py')
-rw-r--r-- | Lib/test/test_kqueue.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py index 93deb1e..eb4865a 100644 --- a/Lib/test/test_kqueue.py +++ b/Lib/test/test_kqueue.py @@ -22,6 +22,7 @@ class TestKQueue(unittest.TestCase): self.assertRaises(ValueError, kq.fileno) def test_create_event(self): + from operator import lt, le, gt, ge fd = sys.stderr.fileno() ev = select.kevent(fd) other = select.kevent(1000) @@ -33,12 +34,12 @@ class TestKQueue(unittest.TestCase): self.assertEqual(ev.udata, 0) self.assertEqual(ev, ev) self.assertNotEqual(ev, other) - self.assertEqual(cmp(ev, other), -1) self.assert_(ev < other) self.assert_(other >= ev) - self.assertRaises(TypeError, cmp, ev, None) - self.assertRaises(TypeError, cmp, ev, 1) - self.assertRaises(TypeError, cmp, ev, "ev") + for op in lt, le, gt, ge: + self.assertRaises(TypeError, op, ev, None) + self.assertRaises(TypeError, op, ev, 1) + self.assertRaises(TypeError, op, ev, "ev") ev = select.kevent(fd, select.KQ_FILTER_WRITE) self.assertEqual(ev.ident, fd) |