Last active
March 16, 2018 23:28
-
-
Save lmazuel/aceffb04d8f97284dcd61a438262c85d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import pytest | |
@pytest.mark.asyncio | |
async def test(): | |
iterator = iter([]) | |
return await asyncio.get_event_loop().run_in_executor( | |
None, | |
next, | |
iterator | |
) # Deadlock | |
# This freeze pytest. Test should raise the TypeError of Python: | |
# File "<c:\program files (x86)\python35-32\lib\asyncio\futures.py>", line 365, in set_exception | |
# raise TypeError("StopIteration interacts badly with generators " | |
# TypeError: StopIteration interacts badly with generators and cannot be raised into a Future |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment