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 2021/03/19 16:50:30 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture

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



##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
 from tests.test_utils.decorators import dont_initialize_flask_app_submodules
 
 
-class TestDagRunsEndpoint(unittest.TestCase):
-    @classmethod
-    def setUpClass(cls):
-        super().setUpClass()
+@pytest.fixture(scope="module")

Review comment:
       My understanding is, the fixuture’s lifeline is not tied to the module *itself*, but pytest internally tracks whether all tests in the module and tears down the fixture after they all run. `scope` means more like “tests in this scope” in the lexical sense, not the actual function/class/module the fixture lives in.




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