hughhhh commented on code in PR #20380:
URL: https://github.com/apache/superset/pull/20380#discussion_r899288380


##########
tests/integration_tests/datasource_tests.py:
##########
@@ -385,21 +387,30 @@ def my_check(datasource):
         app.config["DATASET_HEALTH_CHECK"] = my_check
         self.login(username="admin")
         tbl = self.get_table(name="birth_names")
-        datasource = ConnectorRegistry.get_datasource("table", tbl.id, 
db.session)
+        datasource = 
db.session.query(SqlaTable).filter_by(id=tbl.id).one_or_none()
         assert datasource.health_check_message == "Warning message!"
         app.config["DATASET_HEALTH_CHECK"] = None
 
     def test_get_datasource_failed(self):
+        from superset.datasource.dao import DatasourceDAO
+
         pytest.raises(
-            DatasetNotFoundError,
-            lambda: ConnectorRegistry.get_datasource("table", 9999999, 
db.session),
+            DatasourceNotFound,
+            lambda: DatasourceDAO.get_datasource(db.session, "table", 9999999),

Review Comment:
   These are testing the actual function calls inside the `views/datasource.py` 
files which call `DatasourceDAO` now



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to