summaryrefslogtreecommitdiff
path: root/asyncio/test_utils.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-25 15:09:38 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-01-25 15:09:38 +0100
commitddb87e686bdb64b9ab5322af63cddff959fcaff2 (patch)
treecd809883994a542ad8535ec8889983a65b023ee4 /asyncio/test_utils.py
parent4a6a9743d0ada897ed5a4f2848b3fb0d232a0504 (diff)
downloadtrollius-ddb87e686bdb64b9ab5322af63cddff959fcaff2.tar.gz
Add a granularity attribute to BaseEventLoop: maximum between the resolution of
the BaseEventLoop.time() method and the resolution of the selector. The granuarility is used in the scheduler to round time and deadline.
Diffstat (limited to 'asyncio/test_utils.py')
-rw-r--r--asyncio/test_utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/asyncio/test_utils.py b/asyncio/test_utils.py
index ccb4454..42b9cd7 100644
--- a/asyncio/test_utils.py
+++ b/asyncio/test_utils.py
@@ -144,6 +144,10 @@ class TestSelector(selectors.BaseSelector):
def __init__(self):
self.keys = {}
+ @property
+ def resolution(self):
+ return 1e-3
+
def register(self, fileobj, events, data=None):
key = selectors.SelectorKey(fileobj, 0, events, data)
self.keys[fileobj] = key