aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mycli/fix-sqlparse.patch
blob: 0ad9eb414577f57715b2e62c6fdf1e667d99abdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 3acecd9d69e87333c1887dc2e797fa20300b9a44 Mon Sep 17 00:00:00 2001
From: Dick Marinus <dick@mrns.nl>
Date: Sat, 18 May 2019 21:15:32 +0200
Subject: [PATCH] fix unit tests, hard depend on 0.3.0

---
 mycli/packages/completion_engine.py | 2 +-
 setup.py                            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mycli/packages/completion_engine.py b/mycli/packages/completion_engine.py
index 2426f30c..c63a3428 100644
--- a/mycli/packages/completion_engine.py
+++ b/mycli/packages/completion_engine.py
@@ -84,7 +84,7 @@ def suggest_type(full_text, text_before_cursor):
         # Be careful here because trivial whitespace is parsed as a statement,
         # but the statement won't have a first token
         tok1 = statement.token_first()
-        if tok1 and tok1.value in ['\\', 'source']:
+        if tok1 and (tok1.value == 'source' or tok1.value.startswith('\\')):
             return suggest_special(text_before_cursor)
 
     last_token = statement and statement.token_prev(len(statement.tokens))[1] or ''
diff --git a/setup.py b/setup.py
index 67ad0c85..3081f19c 100755
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
     'Pygments >= 1.6',
     'prompt_toolkit>=2.0.6',
     'PyMySQL >= 0.9.2',
-    'sqlparse>=0.2.2,<0.3.0',
+    'sqlparse>=0.3.0,<0.4.0',
     'configobj >= 5.0.5',
     'cryptography >= 1.0.0',
     'cli_helpers[styles] >= 1.0.1',