summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2017-05-25 08:52:13 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2017-05-25 08:52:13 +0200
commitdc788ab5b1af2e2a4a988b31a09d8d6656853f76 (patch)
treeca574d197ebe87165e5407c8090cfdd50d00b171 /tests/test_parse.py
parent0b467460762c51d5480271a7010c5936a116317b (diff)
downloadsqlparse-dc788ab5b1af2e2a4a988b31a09d8d6656853f76.tar.gz
Recognize MySQL table names starting with digits (fixes #337).
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 0632889..4ba6ca1 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -135,11 +135,14 @@ def test_quoted_identifier():
assert t[2].get_real_name() == 'y'
-@pytest.mark.parametrize('name', ['foo', '_foo'])
+@pytest.mark.parametrize('name', [
+ 'foo', '_foo', # issue175
+ '1_data', # valid MySQL table name, see issue337
+])
def test_valid_identifier_names(name):
- # issue175
t = sqlparse.parse(name)[0].tokens
assert isinstance(t[0], sql.Identifier)
+ assert t[0].get_name() == name
def test_psql_quotation_marks():