pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Pytest Recursive Logging Redirection within Airflow Task

Open JonnyWaffles opened this issue 2 years ago • 2 comments

Hi team, I am trying to run Pytest inside of an Airflow task. Doing so causes a recursive logging scenario. As I understand it based on https://github.com/apache/airflow/discussions/30107#discussioncomment-5314709, Airflow tasks redirects logs back to stdout and then Pytest redirects the same, thus causing the recursion. I searched your documentation and tried all the various log capture parameters (-s, --capture=fs, etc), but nothing seems to do the trick. Apologies for the misunderstanding, but is there a way I can tell Pytest not to perform whichever redirection is causing the behavior described in the Airflow comment?

JonnyWaffles avatar Mar 23 '23 18:03 JonnyWaffles

A proper integration seems to be necessary

Im under the impression that both stdio capture and log capture have to be disable in airflow

RonnyPfannschmidt avatar Mar 23 '23 18:03 RonnyPfannschmidt

pytest -p no:logging to disable pytest's logging plugin entirely?

Zac-HD avatar Feb 17 '24 20:02 Zac-HD

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Mar 03 '24 01:03 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Mar 10 '24 01:03 github-actions[bot]