Commit 6402213
authored
Export AIRFLOW_TEST_MODE from airflow tasks test without --env-vars (#72291)
* Export AIRFLOW_TEST_MODE from airflow tasks test without --env-vars
The test-mode signal has been hostage to an unrelated flag since it was
introduced in 2020, so Dag code that branches on it never saw it during a
plain `airflow tasks test` run. In Airflow 3 this is the only working
test-mode signal, because the `test_mode` task-context variable is
currently disabled.
* Stop the env-vars test leaking its writes into the pytest session
monkeypatch.delenv records an undo entry only when the key is already set,
so on a clean worker the values task_test writes to the real process
environment survived teardown. Seeding a sentinel instead also tightens the
assertion: the command now has to overwrite a pre-existing value rather than
merely populate an absent one.
---------
Co-authored-by: Eason09053360 <185830721+Eason09053360@users.noreply.github.com>1 parent b072197 commit 6402213
2 files changed
Lines changed: 15 additions & 5 deletions
File tree
- airflow-core
- src/airflow/cli/commands
- tests/unit/cli/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
| |||
225 | 236 | | |
226 | 237 | | |
227 | 238 | | |
228 | | - | |
229 | | - | |
| 239 | + | |
230 | 240 | | |
231 | 241 | | |
232 | 242 | | |
233 | 243 | | |
234 | | - | |
| 244 | + | |
235 | 245 | | |
236 | 246 | | |
237 | 247 | | |
| |||
0 commit comments