Skip to content

Commit

Permalink
Use Trio's new CancelScope API
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Jan 28, 2019
1 parent 5e12d31 commit 32e1c6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pytest_trio/_tests/test_fixture_ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def crash_late_agen():
raise RuntimeError("crash_late_agen".upper())
async def crash(when, token):
with trio.open_cancel_scope(shield=True):
with trio.CancelScope(shield=True):
await trio.sleep(when)
raise RuntimeError(token.upper())
Expand Down
4 changes: 2 additions & 2 deletions pytest_trio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ async def run(self, test_ctx, contextvars_ctx):
# should cancel them.
assert not self.user_done_events
func_value = None
with trio.open_cancel_scope() as cancel_scope:
with trio.CancelScope() as cancel_scope:
test_ctx.test_cancel_scope = cancel_scope
assert not test_ctx.crashed
await self._func(**resolved_kwargs)
Expand Down Expand Up @@ -280,7 +280,7 @@ async def run(self, test_ctx, contextvars_ctx):
except BaseException as exc:
assert isinstance(exc, trio.Cancelled)
test_ctx.crash(None)
with trio.open_cancel_scope(shield=True):
with trio.CancelScope(shield=True):
for event in self.user_done_events:
await event.wait()

Expand Down

0 comments on commit 32e1c6c

Please sign in to comment.