dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 191 forks source link

Investigate test failure for test_show_function_definition_command #345

Open ellbosch opened 4 years ago

ellbosch commented 4 years ago

macOS build failed on 11/13. Marked as a test teardown failure. Stack trace:

self = <mssqlcli.mssqlcliclient.MssqlCliClient object at 0x10badd5f8>
query = 'DROP DATABASE mssql_cli_db_c6b0809eb4aa45c3b63c44bd22934132;'

    def execute_query(self, query):
        # Try to run first as special command
        try:
>           for rows, columns, status, statement, is_error in special.execute(self, query):

mssqlcli/mssqlcliclient.py:95: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

mssqlcliclient = <mssqlcli.mssqlcliclient.MssqlCliClient object at 0x10badd5f8>
sql = 'DROP DATABASE mssql_cli_db_c6b0809eb4aa45c3b63c44bd22934132;'

    @export
    def execute(mssqlcliclient, sql):
        """Execute a special command and return the results. If the special command
        is not supported a KeyError will be raised.
        """
        command, verbose, pattern = parse_special_command(sql)

        if (command not in COMMANDS) and (command.lower() not in COMMANDS):
>           raise CommandNotFound('Command not found: %s' % command)
E           mssqlcli.packages.special.main.CommandNotFound: Command not found: DROP

mssqlcli/packages/special/main.py:63: CommandNotFound

During handling of the above exception, another exception occurred:

cls = <class 'test_special.SpecialCommandsTests'>

    @classmethod
    def tearDownClass(cls):
        try:
            # delete the database objects created
            client = create_mssql_cli_client()
>           list(client.execute_query('DROP DATABASE {0};'.format(cls.database)))

tests/test_special.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
mssqlcli/mssqlcliclient.py:108: in execute_query
    for rows, columns, status, statement, is_error in self._execute_query(single_query):
mssqlcli/mssqlcliclient.py:115: in _execute_query
    query_response, query_messages, query_had_error = self._execute_query_execute_request_for(query)
mssqlcli/mssqlcliclient.py:198: in _execute_query_execute_request_for
    exit(1)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Use exit() or Ctrl-D (i.e. EOF) to exit, code = 1

    def __call__(self, code=None):
        # Shells like IDLE catch the SystemExit, but listen when their
        # stdin wrapper is closed.
        try:
            sys.stdin.close()
        except:
            pass
>       raise SystemExit(code)
E       SystemExit: 1

.tox/py36/lib/python3.6/site.py:397: SystemExit