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

kaxil 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 080ad504f97 Update `CLAUDE.md` to use decorators instead of `with` 
when possible (#68035)
080ad504f97 is described below

commit 080ad504f97b87bc069c7dc7017eb05d7386780a
Author: Vincent <[email protected]>
AuthorDate: Thu Jun 4 13:14:35 2026 -0700

    Update `CLAUDE.md` to use decorators instead of `with` when possible 
(#68035)
---
 AGENTS.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/AGENTS.md b/AGENTS.md
index f3dde9cbd07..0e51013c2cf 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -148,8 +148,9 @@ reported as such are described in "What is NOT considered a 
security vulnerabili
 - Add tests for new behavior — cover success, failure, and edge cases.
 - Use pytest patterns, not `unittest.TestCase`.
 - Use `spec`/`autospec` when mocking.
+- Prefer `@mock.patch` decorators over `with mock.patch(...)` context managers 
for patching. Use `conf_vars` (from `tests_common.test_utils.config`) for 
Airflow config overrides — as a decorator when the value is fixed, as a context 
manager when it varies via `@pytest.mark.parametrize`.
 - Use `time_machine` for time-dependent tests. Do not use `datetime.now()`
-- Use `@pytest.mark.parametrize` for multiple similar inputs.
+- Use `@pytest.mark.parametrize` for multiple similar inputs — consolidate 
tests that only differ in input/expected values into a single parametrized test.
 - Use `@pytest.mark.db_test` for tests that require database access.
 - Test fixtures: `devel-common/src/tests_common/pytest_plugin.py`.
 - Test location mirrors source: `airflow/cli/cli_parser.py` → 
`tests/cli/test_cli_parser.py`.

Reply via email to