def METHOD_NAME(parser_class):
    from google.cloud.bigquery.magics.line_arg_parser import ParseError
    from google.cloud.bigquery.magics.line_arg_parser import TokenType
    from google.cloud.bigquery.magics.line_arg_parser.lexer import Token
    # A simple iterable of Tokens is sufficient.
    fake_lexer = [Token(TokenType.OPTION_SPEC, lexeme="--verbose", pos=75)]
    parser = parser_class(fake_lexer)
    error_pattern = r"Unexpected token.*OPTION_SPEC.*position 75.*"
    with pytest.raises(ParseError, match=error_pattern):
        parser.py_value()