https://prefect.io logo
v

Vadym Dytyniak

12/05/2022, 3:06 PM
Hi. How to test the Prefect 2 task that uses
get_run_logger
? When I try to use task.fn it fails with no task or flow context.
1
j

Justin Trautmann

12/05/2022, 3:08 PM
Copy code
from prefect.logging.loggers import disable_run_logger

with disable_run_logger():
    task.fn()
upvote 2
🙏 2
v

Vadym Dytyniak

12/05/2022, 3:08 PM
Oh, interesting
v

Vadym Dytyniak

12/05/2022, 3:10 PM
Thanks!