This is an automated email from the ASF dual-hosted git repository.

Lee-W pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6072580b9e7 Clarify unit test mock example with spec (#69428)
6072580b9e7 is described below

commit 6072580b9e76c10c764d9442a584e9f0a582da26
Author: Aaron Chen <[email protected]>
AuthorDate: Fri Jul 10 14:25:30 2026 +0800

    Clarify unit test mock example with spec (#69428)
---
 contributing-docs/testing/unit_tests.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contributing-docs/testing/unit_tests.rst 
b/contributing-docs/testing/unit_tests.rst
index 0b6cbb31a5e..d3f58af6cae 100644
--- a/contributing-docs/testing/unit_tests.rst
+++ b/contributing-docs/testing/unit_tests.rst
@@ -658,7 +658,7 @@ You can make the code conditional and mock out ``Variable`` 
to avoid hitting the
 
     if os.environ.get("_AIRFLOW_SKIP_DB_TESTS") == "true":
         # Handle collection of the test by non-db case
-        Variable = mock.MagicMock()  # type: ignore[misc] # noqa: F811
+        Variable = mock.MagicMock(spec=Variable)  # type: ignore[misc] # noqa: 
F811
     else:
         initial_db_init()
 

Reply via email to