Esempio n. 1
0
def format_sql(s, debug=False):
    tokens = list(tokenize(s))
    if debug:
        print_non_data('Tokens: %s' % tokens)
    parsed = list(parse(tokens))
    if debug:
        print_non_data('Statements: %s' % parsed)
    styled = style(parsed)
    if debug:
        print_non_data('Output: %s' % styled)
    return styled
Esempio n. 2
0
def test_parse_exceptions(tokens, exception):
    with pytest.raises(exception):
        list(parse(tokens))
Esempio n. 3
0
def assert_statements(tokens1, statements2):
    parsed_statements = list(parse(tokens1))
    assert parsed_statements == statements2
Esempio n. 4
0
def test_parse_exceptions(tokens, exception):
    with pytest.raises(exception):
        list(parse(tokens))
Esempio n. 5
0
def assert_statements(tokens1, statements2):
    parsed_statements = list(parse(tokens1))
    assert parsed_statements == statements2