Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
njsmith committed Jul 28, 2018
1 parent 43bbe3b commit ffb007f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sniffio/_tests/test_sniffio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
import asyncio

from .. import (
current_async_library, AsyncLibraryNotFoundError,
Expand All @@ -22,6 +21,11 @@ def test_basics():


def test_asyncio():
import asyncio

with pytest.raises(AsyncLibraryNotFoundError):
current_async_library()

ran = []

async def this_is_asyncio():
Expand All @@ -32,3 +36,6 @@ async def this_is_asyncio():
loop.run_until_complete(this_is_asyncio())
assert ran == [True]
loop.close()

with pytest.raises(AsyncLibraryNotFoundError):
current_async_library()

0 comments on commit ffb007f

Please sign in to comment.