https://prefect.io logo
Title
j

John-Craig Borman

12/27/2022, 7:35 PM
Hi all, I'm working on unit testing some flows in Prefect 2 - what are the best practices for populating Blocks via Pytest fixtures?
👀 1
1
a

Andrew Huang

12/27/2022, 8:14 PM
Here’s an example with prefect-aws define the credentials block in conftest https://github.com/PrefectHQ/prefect-aws/blob/main/tests/conftest.py#L17-L30 and then pass into test args https://github.com/PrefectHQ/prefect-aws/blob/main/tests/test_secrets_manager.py#L58-L69 the
prefect_db
fixture is so it doesn’t save the test flow runs into your actual db