uranusjr commented on pull request #19194:
URL: https://github.com/apache/airflow/pull/19194#issuecomment-950553256
It's probably better to refactor using `paramtrize` instead, something like
```python
def _failure():
raise AirflowException
def _skip():
raise AirflowSkipException
# Others...
@pytest.mark.parametrize(
"state, func",
[
(State.FAILED, _failure),
(State.SKIPPED, _skip),
# Others...
],
)
def test_task_wipes_next_fields(self, session, dag_maker, state, func):
with dag_maker("test_deferred_method_clear"):
task = PythonOperator(
...,
python_callable=func,
)
...
```
--
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]