Skip to content

ASYNC100 should not trigger for blocks containing a yield statement #224

@Zac-HD

Description

@Zac-HD
@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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions