From: Victor Stinner Date: Sat, 1 Feb 2014 01:17:54 +0000 (+0100) Subject: Issue #20452: test_asyncio checks also the granularity X-Git-Tag: v3.4.0rc1~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1144214639293d829021902307ef306c305560ba;p=thirdparty%2FPython%2Fcpython.git Issue #20452: test_asyncio checks also the granularity --- diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 24808cb11c77..3ca35eb2d170 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -1179,6 +1179,14 @@ class EventLoopTestsMixin: calls.append(self.loop._run_once_counter) self.assertEqual(calls, [1, 3, 5, 6]) + def test_granularity(self): + granularity = self.loop._granularity + self.assertGreater(granularity, 0.0) + # Worst expected granularity: 1 ms on Linux (limited by poll/epoll + # resolution), 15.6 ms on Windows (limited by time.monotonic + # resolution) + self.assertLess(granularity, 0.050) + class SubprocessTestsMixin: