def assert_parsed_same_as_python(expr_str):
    (expr_str,) = expr_str.split('\n')
    from pymbolic.interop.ast import ASTToPymbolic
    import ast
    ast2p = ASTToPymbolic()
    try:
        expr_parsed_by_python = ast2p(ast.parse(expr_str).body[0].value)
    except SyntaxError:
        with pytest.raises(ParseError):
            parse(expr_str)
    else:
        expr_parsed_by_pymbolic = parse(expr_str)
        assert (expr_parsed_by_python == expr_parsed_by_pymbolic)
def assert_parsed_same_as_python(expr_str):
    (expr_str,) = expr_str.split('\n')
    from pymbolic.interop.ast import ASTToPymbolic
    import ast
    ast2p = ASTToPymbolic()
    try:
        expr_parsed_by_python = ast2p(ast.parse(expr_str).body[0].value)
    except SyntaxError:
        with pytest.raises(ParseError):
            parse(expr_str)
    else:
        expr_parsed_by_pymbolic = parse(expr_str)
        assert (expr_parsed_by_python == expr_parsed_by_pymbolic)