We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6035572 commit 407d444Copy full SHA for 407d444
tests/core/test_object_proxy.py
@@ -838,6 +838,29 @@ def __exit__(*args, **kwargs):
838
with wrapper:
839
pass
840
841
+ def test_async_context_manager(self):
842
+ class Class:
843
+ async def __aenter__(self):
844
+ return self
845
+
846
+ async def __aexit__(*args, **kwargs):
847
+ return
848
849
+ instance = Class()
850
851
+ wrapper = wrapt.ObjectProxy(instance)
852
853
+ async def run():
854
+ async with wrapper:
855
+ pass
856
857
+ import asyncio
858
859
+ loop = asyncio.new_event_loop()
860
+ asyncio.set_event_loop(loop)
861
+ loop.run_until_complete(run())
862
+ loop.close()
863
864
865
class TestEqualityObjectProxy(unittest.TestCase):
866
0 commit comments