You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/29 10:04:48 UTC

[GitHub] [superset] kstrz commented on a change in pull request #12762: test: fix cleanup ds in fixtures

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



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

Review comment:
       Do you mean `finally` in `try` block? I think `tearDown` would be a a bit hacky because it is test specific object. It is more general problem. There are many tests that create some specific objects and delete them after assertion. I wonder how should we refactor them. Creating tests specific fixtures or context managers would result in many additional lines of code and make tests less readable. On the other hand if any test fails that means something should be fixed and next failures caused by side effects of the failed test may be not so important. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org