Skip to content

Commit

Permalink
Add regression test for python-trio#552
Browse files Browse the repository at this point in the history
  • Loading branch information
oremanj committed Aug 7, 2019
1 parent 23c089d commit 0aada63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions trio/_core/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,16 @@ async def misguided():
assert any(entry.name == "child_xyzzy" for entry in excinfo.traceback)


async def test_asyncio_function_inside_nursery_does_not_explode():
# Regression test for https://github.com/python-trio/trio/issues/552
with pytest.raises(TypeError) as excinfo:
async with _core.open_nursery() as nursery:
import asyncio
nursery.start_soon(sleep_forever)
await asyncio.Future()
assert "asyncio" in str(excinfo.value)


async def test_trivial_yields():
with assert_checkpoints():
await _core.checkpoint()
Expand Down

0 comments on commit 0aada63

Please sign in to comment.