Skip to content

Commit

Permalink
Docs: Fix heading for Mocking section in best-practices.rst (#13658)
Browse files Browse the repository at this point in the history
Currently 'Mocking variables and connections' section is on same level
as Best Practices (`h1` heading):

http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/best-practices.html

Because of which this heading shows in TOC

(cherry picked from commit 21446d6)
  • Loading branch information
kaxil committed Jan 21, 2021
1 parent 62f365f commit 6dda6d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/apache-airflow/best-practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ You can use environment variables to parameterize the DAG.
)
Mocking variables and connections
=================================
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When you write tests for code that uses variables or a connection, you must ensure that they exist when you run the tests. The obvious solution is to save these objects to the database so they can be read while your code is executing. However, reading and writing objects to the database are burdened with additional time overhead. In order to speed up the test execution, it is worth simulating the existence of these objects without saving them to the database. For this, you can create environment variables with mocking :any:`os.environ` using :meth:`unittest.mock.patch.dict`.

Expand Down

0 comments on commit 6dda6d4

Please sign in to comment.