summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_selectors.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py
index ca09851..a2ffd62 100644
--- a/Lib/test/test_selectors.py
+++ b/Lib/test/test_selectors.py
@@ -264,18 +264,19 @@ class BaseSelectorTestCase(unittest.TestCase):
t = time()
self.assertEqual(1, len(s.select(0)))
self.assertEqual(1, len(s.select(-1)))
- self.assertTrue(time() - t < 0.5)
+ self.assertLess(time() - t, 0.5)
s.unregister(wr)
s.register(rd, selectors.EVENT_READ)
t = time()
self.assertFalse(s.select(0))
self.assertFalse(s.select(-1))
- self.assertTrue(time() - t < 0.5)
+ self.assertLess(time() - t, 0.5)
- t = time()
+ t0 = time()
self.assertFalse(s.select(1))
- self.assertTrue(0.5 < time() - t < 1.5)
+ t1 = time()
+ self.assertTrue(0.5 < t1 - t0 < 1.5, t1 - t0)
@unittest.skipUnless(hasattr(signal, "alarm"),
"signal.alarm() required for this test")