milton0825 commented on a change in pull request #5343: [AIRFLOW-4591][WIP] 
Make default_pool a real pool
URL: https://github.com/apache/airflow/pull/5343#discussion_r289229778
 
 

 ##########
 File path: tests/models/test_pool.py
 ##########
 @@ -25,18 +25,25 @@
 from airflow.models.taskinstance import TaskInstance as TI
 from airflow.operators.dummy_operator import DummyOperator
 from airflow.utils import timezone
+from airflow.utils.db import add_default_pool_if_not_exists
 from airflow.utils.state import State
-from tests.test_utils.db import clear_db_pools, clear_db_runs
-from tests.test_utils.decorators import mock_conf_get
+from tests.test_utils.db import clear_db_pools, clear_db_runs, 
set_default_pool_slots
 
 DEFAULT_DATE = timezone.datetime(2016, 1, 1)
 
 
 class PoolTest(unittest.TestCase):
 
-    def tearDown(self):
+    def setUp(self):
         clear_db_runs()
         clear_db_pools()
+        add_default_pool_if_not_exists()
+
+    @classmethod
+    def tearDownClass(cls):
 
 Review comment:
   We already `clear_db_pools` in `setUp` so no need to run it in `tearDown`. 
The reason I put it in `tearDownClass` is that we can clean up after the whole 
test suite is finished.

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


With regards,
Apache Git Services

Reply via email to