def METHOD_NAME(mocker):
    mock = mocker.patch("tkinter.Tk.report_callback_exception")
    yield
    if mock.call_count != 0:
        exc_type, exc_value, exc_tb = mock.call_args.args
        raise ValueError("error in tkinter callback while running test") from exc_value