ashb commented on a change in pull request #17552:
URL: https://github.com/apache/airflow/pull/17552#discussion_r709083505
##########
File path: docs/apache-airflow/best-practices.rst
##########
@@ -270,77 +275,73 @@ Unit tests ensure that there is no incorrect code in your
DAG. You can write uni
.. code-block:: python
- from airflow.models import DagBag
- import unittest
+ import pytest
+ from airflow.models import DagBag
- class TestHelloWorldDAG(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- cls.dagbag = DagBag()
- def test_dag_loaded(self):
- dag = self.dagbag.get_dag(dag_id="hello_world")
- assert self.dagbag.import_errors == {}
- assert dag is not None
- assert len(dag.tasks) == 1
+ @pytest.fixture(scope="scope")
Review comment:
```suggestion
@pytest.fixture(scope="module")
```
I think?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]