This is an automated email from the ASF dual-hosted git repository. hugh pushed a commit to branch fix-logs-sqllab in repository https://gitbox.apache.org/repos/asf/superset.git
commit c85e9415df3548abf421b51c198f91e0d1b92389 Author: hughhhh <[email protected]> AuthorDate: Thu Oct 6 14:27:07 2022 -0400 yerp --- tests/integration_tests/sqllab_tests.py | 64 --------------------------------- 1 file changed, 64 deletions(-) diff --git a/tests/integration_tests/sqllab_tests.py b/tests/integration_tests/sqllab_tests.py index b78b33d04e..0c4019e7d9 100644 --- a/tests/integration_tests/sqllab_tests.py +++ b/tests/integration_tests/sqllab_tests.py @@ -821,70 +821,6 @@ class TestSqlLab(SupersetTestCase): }, ) - @mock.patch("superset.sql_lab.get_query") - @mock.patch("superset.sql_lab.execute_sql_statement") - def test_execute_sql_statements_syntax_error( - self, mock_execute_sql_statement, mock_get_query - ): - sql = """ - -- comment - SET @value = 42; - SELECT @value AS foo; - -- comment - """ - mock_session = mock.MagicMock() - mock_query = mock.MagicMock() - mock_query.database.allow_run_async = False - mock_cursor = mock.MagicMock() - mock_query.database.get_sqla_engine.return_value.raw_connection.return_value.cursor.return_value = ( - mock_cursor - ) - mock_query.database.db_engine_spec.run_multiple_statements_as_one = False - mock_get_query.return_value = mock_query - - s2_error = SupersetError( - message="foo", - error_type=SupersetErrorType.SYNTAX_ERROR, - level=ErrorLevel.ERROR, - ) - mock_execute_sql_statement.side_effect = SupersetErrorException(s2_error) - with pytest.raises(SupersetErrorException) as excinfo: - execute_sql_statements( - query_id=1, - rendered_query=sql, - return_results=True, - store_results=False, - session=mock_session, - start_time=None, - expand_data=False, - log_params=None, - ) - - assert excinfo.value.error == s2_error - assert False is True - - - # mock_execute_sql_statement.assert_has_calls( - # [ - # mock.call( - # "SET @value = 42", - # mock_query, - # mock_session, - # mock_cursor, - # None, - # False, - # ), - # mock.call( - # "SELECT @value AS foo", - # mock_query, - # mock_session, - # mock_cursor, - # None, - # False, - # ), - # ] - # ) - @mock.patch("superset.sql_lab.get_query") @mock.patch("superset.sql_lab.execute_sql_statement") def test_execute_sql_statements_ctas(
