multimeric commented on issue #58893:
URL: https://github.com/apache/airflow/issues/58893#issuecomment-3673321035
This PR is very helpful, but it doesn't cover the common case of passing
XCom arguments to the unit tested task.
```python
@task
def add_numbers(a: int, b: int):
return a + b
ti = TaskInstance(task=add_numbers, run_id="test_run")
# How can we pass in a and b here?
ti.run(ignore_ti_state=True)
assert ti.state == TaskInstanceState.SUCCESS
```
`TaskInstance.run()` doesn't let you pass in XCom arguments. Maybe there's a
solution involving mocking `ti.xcom_pull()`?
--
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]