def test_expression_complex(string: str, expected: expr.Expr) -> None: actual = parse_bool_expression(string, extended=True) assert actual == expected assert actual.location
def test_expression_boolean(string: str, expected: expr.Expr) -> None: actual = parse_bool_expression(string, extended=False) assert actual == expected assert actual.location
def test_boolean_expression_error(string: str, error: expr.Expr) -> None: with pytest.raises((KeyError, NotImplementedError), match=rf"^{error}$"): parse_bool_expression(string, extended=False)
def test_parsing_boolean_expressions(expression: expr.Expr) -> None: parsed_expression = parse_bool_expression(str(expression), extended=True) assert parsed_expression == expression