How to use the turbodbc.Error function in turbodbc

To help you get started, we’ve selected a few turbodbc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github blue-yonder / turbodbc / python / turbodbc_test / test_executemanycolumns_corner_cases.py View on Github external
def test_executemanycolumns_without_numpy_support(dsn, configuration):
    with open_cursor(configuration) as cursor:
        with patch('turbodbc.cursor._has_numpy_support', return_value=False):
            with pytest.raises(turbodbc.Error):
                cursor.executemanycolumns("SELECT 42", [])
github blue-yonder / turbodbc / python / turbodbc_test / test_select_arrow.py View on Github external
def test_no_arrow_support(dsn, configuration):
    with open_cursor(configuration) as cursor:
        cursor.execute("SELECT 42")
        with patch('turbodbc.cursor._has_arrow_support', return_value=False):
            with pytest.raises(turbodbc.Error):
                cursor.fetchallarrow()
github blue-yonder / turbodbc / python / turbodbc_test / test_cursor_select.py View on Github external
def test_select_with_too_many_parameters_raises(dsn, configuration):
    with open_cursor(configuration) as cursor:
        with pytest.raises(turbodbc.Error):
            cursor.execute("SELECT 42", [42])

        with pytest.raises(turbodbc.Error):
            cursor.executemany("SELECT 42", [[42]])
github blue-yonder / turbodbc / python / turbodbc_test / test_cursor_select.py View on Github external
def test_select_with_too_many_parameters_raises(dsn, configuration):
    with open_cursor(configuration) as cursor:
        with pytest.raises(turbodbc.Error):
            cursor.execute("SELECT 42", [42])

        with pytest.raises(turbodbc.Error):
            cursor.executemany("SELECT 42", [[42]])
github blue-yonder / turbodbc / python / turbodbc_test / test_cursor_basics.py View on Github external
def test_rowcount_is_reset_after_executemanycolumns_raises(dsn, configuration):
    with open_cursor(configuration) as cursor:
        with query_fixture(cursor, configuration, 'INSERT INTEGER') as table_name:
            cursor.execute("INSERT INTO {} VALUES (?)".format(table_name), [42])
            assert cursor.rowcount == 1
            with pytest.raises(Error):
                cursor.executemanycolumns("this is not even a valid SQL statement", [])
            assert cursor.rowcount == -1
github blue-yonder / turbodbc / python / turbodbc_test / test_select_numpy.py View on Github external
def test_no_numpy_support(dsn, configuration):
    with open_cursor(configuration) as cursor:
        cursor.execute("SELECT 42")
        with patch('turbodbc.cursor._has_numpy_support', return_value=False):
            with pytest.raises(turbodbc.Error):
                cursor.fetchallnumpy()
github blue-yonder / turbodbc / python / turbodbc_test / test_cursor_basics.py View on Github external
def test_rowcount_is_reset_after_execute_raises(dsn, configuration):
    with open_cursor(configuration) as cursor:
        with query_fixture(cursor, configuration, 'INSERT INTEGER') as table_name:
            cursor.execute("INSERT INTO {} VALUES (?)".format(table_name), [42])
            assert cursor.rowcount == 1
            with pytest.raises(Error):
                cursor.execute("this is not even a valid SQL statement")
            assert cursor.rowcount == -1