diff --git a/pgcli/main.py b/pgcli/main.py index 758ae9b2..66675693 100755 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -20,7 +20,6 @@ try: import setproctitle except ImportError: setproctitle = None -import sqlparse from prompt_toolkit import CommandLineInterface, Application, AbortAction from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode from prompt_toolkit.shortcuts import create_prompt_layout, create_eventloop diff --git a/pgcli/pgexecute.py b/pgcli/pgexecute.py index e01c734c..6f954ff8 100644 --- a/pgcli/pgexecute.py +++ b/pgcli/pgexecute.py @@ -1,6 +1,5 @@ import traceback import logging -import pprint import itertools import psycopg2 import psycopg2.extras diff --git a/tests/features/environment.py b/tests/features/environment.py index a92c455b..a6918146 100644 --- a/tests/features/environment.py +++ b/tests/features/environment.py @@ -4,7 +4,6 @@ from __future__ import print_function import os import sys -import pexpect import db_utils as dbutils import fixture_utils as fixutils diff --git a/tests/test_expanded.py b/tests/test_expanded.py index 4025dfa4..e1b61a1d 100644 --- a/tests/test_expanded.py +++ b/tests/test_expanded.py @@ -1,5 +1,4 @@ from pgcli.packages.expanded import expanded_table -import pytest def test_expanded_table_renders(): input = [("hello", 123),("world", 456)] diff --git a/tests/test_fuzzy_completion.py b/tests/test_fuzzy_completion.py index 6ec8f5f2..bf981ebf 100644 --- a/tests/test_fuzzy_completion.py +++ b/tests/test_fuzzy_completion.py @@ -1,7 +1,5 @@ from __future__ import unicode_literals import pytest -from prompt_toolkit.completion import Completion -from prompt_toolkit.document import Document @pytest.fixture diff --git a/tests/test_main.py b/tests/test_main.py index 08fd471e..cdf82ce3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,6 +1,5 @@ import os import platform -import stat import mock import pytest diff --git a/tests/test_parseutils.py b/tests/test_parseutils.py index 6855bae4..e80b9357 100644 --- a/tests/test_parseutils.py +++ b/tests/test_parseutils.py @@ -96,11 +96,11 @@ def test_simple_insert_single_table_schema_qualified(): tables = extract_tables('insert into abc.def (id, name) values (1, "def")') assert tables == (('abc', 'def', None, False),) -def test_simple_update_table(): +def test_simple_update_table_no_schema(): tables = extract_tables('update abc set id = 1') assert tables == ((None, 'abc', None, False),) -def test_simple_update_table(): +def test_simple_update_table_with_schema(): tables = extract_tables('update abc.def set id = 1') assert tables == (('abc', 'def', None, False),) diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py index 432375ad..7a88d423 100644 --- a/tests/test_smart_completion_public_schema_only.py +++ b/tests/test_smart_completion_public_schema_only.py @@ -499,17 +499,6 @@ def test_join_functions_using_suggests_common_columns(completer, complete_event) Completion(text='y', start_position=0, display_meta='column')]) -def test_join_functions_using_suggests_common_columns(completer, complete_event): - text = '''SELECT * FROM set_returning_func() f1 - INNER JOIN set_returning_func() f2 USING (''' - pos = len(text) - result = set(completer.get_completions( - Document(text=text, cursor_position=pos), complete_event)) - assert set(result) == set([ - Completion(text='x', start_position=0, display_meta='column'), - Completion(text='y', start_position=0, display_meta='column')]) - - def test_join_functions_on_suggests_columns(completer, complete_event): text = '''SELECT * FROM set_returning_func() f1 INNER JOIN set_returning_func() f2 ON f1.'''