willbarrett commented on a change in pull request #12762:
URL: https://github.com/apache/superset/pull/12762#discussion_r566237637



##########
File path: tests/query_context_tests.py
##########
@@ -113,6 +121,8 @@ def 
test_query_cache_key_changes_when_datasource_is_updated(self):
             datasource_id=payload["datasource"]["id"],
             session=db.session,
         )
+        # if create and update are performed in the same second keys are the 
same
+        sleep(1)

Review comment:
       Can we use a time manipulation library rather than sleeping?

##########
File path: tests/charts/api_tests.py
##########
@@ -686,13 +793,19 @@ def test_update_chart_validate_datasource(self):
         db.session.delete(chart)

Review comment:
       Perhaps this should be in a `finally` or a teardown?

##########
File path: tests/sqllab_tests.py
##########
@@ -600,6 +605,7 @@ def test_api_database(self):
             {r.get("database_name") for r in 
self.get_json_resp(url)["result"]},
         )
         self.delete_fake_db()
+        example_db.expose_in_sqllab = False

Review comment:
       Perhaps this should be reset in a `finally` block in case this test 
raises?

##########
File path: tests/charts/api_tests.py
##########
@@ -590,13 +679,19 @@ def test_update_chart(self):
         db.session.delete(model)
         db.session.commit()
 
+    @pytest.mark.usefixtures("load_birth_names_datasource")
     def test_update_chart_new_owner(self):
         """
         Chart API: Test update set new owner to current user
         """
+        ds_id = (

Review comment:
       It looks like this lookup could be moved to a shared setup function




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

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