summaryrefslogtreecommitdiff
path: root/urwid/tests/test_event_loops.py
diff options
context:
space:
mode:
authorTamas Nepusz <ntamas@gmail.com>2019-10-24 14:19:10 +0200
committerTamas Nepusz <ntamas@gmail.com>2019-10-24 14:19:10 +0200
commita02f7e6c68b04d22780d14611510d1387682908a (patch)
tree8f76cd4a826c7e5aa6b7d6bf8bf55dc8178e1dc7 /urwid/tests/test_event_loops.py
parent96a1be0ddf441244def94a36736084f9b9c780a4 (diff)
downloadurwid-a02f7e6c68b04d22780d14611510d1387682908a.tar.gz
added TrioEventLoop
Diffstat (limited to 'urwid/tests/test_event_loops.py')
-rw-r--r--urwid/tests/test_event_loops.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/urwid/tests/test_event_loops.py b/urwid/tests/test_event_loops.py
index bde0d1b..0d8cc8b 100644
--- a/urwid/tests/test_event_loops.py
+++ b/urwid/tests/test_event_loops.py
@@ -179,3 +179,21 @@ else:
asyncio.ensure_future(error_coro())
self.assertRaises(ZeroDivisionError, evl.run)
+
+
+try:
+ import trio
+except ImportError:
+ pass
+else:
+ class TrioEventLoopTest(unittest.TestCase, EventLoopTestMixin):
+ def setUp(self):
+ self.evl = urwid.TrioEventLoop()
+
+ _expected_idle_handle = None
+
+ def test_error(self):
+ evl = self.evl
+ evl.alarm(0.5, lambda: 1 / 0) # Simulate error in event loop
+ self.assertRaises(ZeroDivisionError, evl.run)
+