diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-01 01:17:54 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-01 01:17:54 (GMT) |
commit | 1144214639293d829021902307ef306c305560ba (patch) | |
tree | 2ab6c9f578ed2063a28e88cbcbefd43824e52d70 /Lib | |
parent | 6d300d672c1467082bfd0573d62a678be15ec981 (diff) | |
download | cpython-1144214639293d829021902307ef306c305560ba.zip cpython-1144214639293d829021902307ef306c305560ba.tar.gz cpython-1144214639293d829021902307ef306c305560ba.tar.bz2 |
Issue #20452: test_asyncio checks also the granularity
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 24808cb..3ca35eb 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: |