@contextmanager
def fail_at_with_error(deadline, error):
with trio.move_on_at(deadline) as cancel_scope: # noqa: ASYNC100
yield cancel_scope
if cancel_scope.cancelled_caught:
raise error
As of the current version, the noqa comment is suppressing an error. However, the move_on_at()could be triggered by checkpoints syntactically outside this block, so I think we should avoid false alarms and allow this case.
As of the current version, the
noqa
comment is suppressing an error. However, themove_on_at()
could be triggered by checkpoints syntactically outside this block, so I think we should avoid false alarms and allow this case.