From 53de29a1c941b69c668d38bc745d9eaa3e023eb0 Mon Sep 17 00:00:00 2001 From: John Bodley Date: Mon, 24 Jun 2024 21:53:22 -0700 Subject: [PATCH] chore(tests): Fix MySQL logic --- tests/integration_tests/databases/commands_tests.py | 2 +- tests/integration_tests/reports/commands_tests.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/integration_tests/databases/commands_tests.py b/tests/integration_tests/databases/commands_tests.py index 8979b91c4724..93a09f480b63 100644 --- a/tests/integration_tests/databases/commands_tests.py +++ b/tests/integration_tests/databases/commands_tests.py @@ -1110,7 +1110,7 @@ def test_database_tables_superset_exception( database = get_example_database() if database.backend == "mysql": return - + mock_find_by_id.return_value = database mock_can_access_database.side_effect = SupersetException("Test Error") mock_g.user = security_manager.find_user("admin") diff --git a/tests/integration_tests/reports/commands_tests.py b/tests/integration_tests/reports/commands_tests.py index e4c64a51b91d..3936888b03ff 100644 --- a/tests/integration_tests/reports/commands_tests.py +++ b/tests/integration_tests/reports/commands_tests.py @@ -1548,8 +1548,6 @@ def test_report_schedule_working_timeout(create_report_slack_chart_working): datetime.utcnow(), ).run() - # Only needed for MySQL, understand why - db.session.commit() logs = db.session.query(ReportExecutionLog).all() # Two logs, first is created by fixture assert len(logs) == 2 @@ -2076,9 +2074,6 @@ def test_grace_period_error(email_mock, create_invalid_sql_alert_email_chart): datetime.utcnow(), ).run() - # Only needed for MySQL, understand why - db.session.commit() - # Assert the email smtp address, asserts a notification was sent with the error assert email_mock.call_args[0][0] == DEFAULT_OWNER_EMAIL assert (