You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/04 06:28:22 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #21983: Simplify tests for CLI connections commands

uranusjr commented on a change in pull request #21983:
URL: https://github.com/apache/airflow/pull/21983#discussion_r819298042



##########
File path: tests/cli/commands/test_connection_command.py
##########
@@ -34,13 +32,11 @@
 from tests.test_utils.db import clear_db_connections
 
 
-class TestCliGetConnection(unittest.TestCase):
-    def setUp(self):
-        self.parser = cli_parser.get_parser()
-        clear_db_connections()
+class TestCliGetConnection:
+    parser = cli_parser.get_parser()
 
-    def tearDown(self):
-        clear_db_connections()
+    def setup_method(self):
+        clear_db_connections(add_default_connections_back=True)

Review comment:
       I think we should do this after the test to clean up properly. Maybe a `setup_class` and a `teardown_method` so we ensure a clean slate both before and after each test.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org