ashb commented on a change in pull request #4912: [AIRFLOW-4083] Add tests for 
link generation utils
URL: https://github.com/apache/airflow/pull/4912#discussion_r265483524
 
 

 ##########
 File path: tests/www/test_utils.py
 ##########
 @@ -26,8 +27,11 @@
 
 class UtilsTest(unittest.TestCase):
 
-    def setUp(self):
-        super(UtilsTest, self).setUp()
+    @classmethod
+    def tearDownClass(cls):
+        import airflow.www.app
+        airflow.www.app.app = None
+        airflow.www.app.appbuilder = None
 
 Review comment:
   So `cached_app`/`cached_appbuilder` are "memoized" meaning they will return 
the previous value of these variables if set, and otherwise construct a new one.
   
   Since we passed custom config we want to "remove" these cached variables so 
other tests that might call cached_app etc _don't_ pick these up.
   
   I'll add this reason as a comment 👍 

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