def _wrapped_call(wrap_controller, func):
    try:
        next(wrap_controller)   # first yield
    except StopIteration:
        _raise_wrapfail(wrap_controller, "did not yield")
    call_outcome = _CallOutcome(func)
    try:
        wrap_controller.send(call_outcome)
        _raise_wrapfail(wrap_controller, "has second yield")
    except StopIteration:
        pass
    return call_outcome.get_result()
Wrap calling to a function with a generator which needs to yield
dataset/ETHPy150Open pytest-dev/pytest/_pytest/vendored_packages/pluggy.py/_wrapped_call