def METHOD_NAME(message: str) -> Iterator[None]:
    with _catch_deprecation_warnings() as ws:
        yield
    assert len(ws) == 1
    recorded_message = ws[0].message
    assert isinstance(recorded_message, Warning)
    assert recorded_message.args[0] == message