jscheffl commented on code in PR #61917:
URL: https://github.com/apache/airflow/pull/61917#discussion_r3068253476
##########
airflow-core/tests/unit/utils/test_db.py:
##########
@@ -485,18 +489,21 @@ def test_mysql_variants_detected(self, mocker):
def test_none_sql_alchemy_conn(self, mocker):
"""Test behavior when SQL_ALCHEMY_CONN is None."""
- mocker.patch.object(settings, "SQL_ALCHEMY_CONN", None)
+ mocker.patch.object(settings._AirflowSettings, "sql_alchemy_conn",
None)
mock_dispose = mocker.patch.object(settings, "dispose_orm")
mock_configure = mocker.patch.object(settings, "configure_orm")
- with AutocommitEngineForMySQL():
- # Should be a no-op when connection string is None
- mock_dispose.assert_not_called()
- mock_configure.assert_not_called()
+ with pytest.raises(RuntimeError, match="connection string not
configured"):
+ with AutocommitEngineForMySQL():
+ pass
+
+ # Should be a no-op when connection string is None
Review Comment:
applied, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]