Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,16 @@ async def coro():
self.loop.set_task_factory(None)
self.assertIsNone(self.loop.get_task_factory())

def test_asyncgen_hooks(self):
async def get_asyncgens():
return sys.get_asyncgen_hooks()

# for sniffio to detect uvloop as asyncio efficiently the running loop
# call_soon module needs to match the asyncgen_hooks module
hooks = self.loop.run_until_complete(get_asyncgen_hooks)
self.assertEqual(hooks.finzalier.__module__, "uvloop.loop")
self.assertEqual(self.loop.call_soon.__module__, "uvloop.loop")

def test_shutdown_asyncgens_01(self):
finalized = list()

Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: language_level=3
# cython: language_level=3, embedsignature=True, binding=True


from .includes cimport uv
Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: language_level=3, embedsignature=True
# cython: language_level=3, embedsignature=True, binding=True

import asyncio
cimport cython
Expand Down