Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for async dispatch #1771

Merged
merged 12 commits into from
Mar 26, 2024
Prev Previous commit
Next Next commit
Fix tests.
  • Loading branch information
corranwebster committed Mar 18, 2024
commit cf8c39daea76cb11fb7b319b4179a1bc57bb6ee9
3 changes: 1 addition & 2 deletions traits/observation/tests/test_observe.py
Original file line number Diff line number Diff line change
@@ -711,8 +711,7 @@ async def handler(event):

with self.assertWarns(RuntimeWarning):
with self.assertRaises(RuntimeError):
async with asyncio.timeout(0.1):
dispatch_same(handler, event)
dispatch_same(handler, event)

self.assertFalse(event.is_set())

2 changes: 1 addition & 1 deletion traits/tests/test_observe.py
Original file line number Diff line number Diff line change
@@ -959,7 +959,7 @@ def setUp(self):
self.addCleanup(_active_handler_tasks.clear)

async def test_async_dispatch(self):
event = Event()
event = asyncio.Event()

obj = SimpleAsyncExample(value='initial', event=event)

Loading