Channels
announcements
ask-marvin
best-practices-coordination-plane
data-ecosystem
data-tricks-and-tips
events
find-a-prefect-job
geo-bay-area
geo-berlin
geo-boston
geo-chicago
geo-colorado
geo-dc
geo-israel
geo-japan
geo-london
geo-nyc
geo-seattle
geo-texas
gratitude
introductions
marvin-in-the-wild
pacc-clearcover-june-12-2023
pacc-may-31-2023
ppcc-may-16-2023
prefect-ai
prefect-aws
prefect-azure
prefect-cloud
prefect-community
prefect-contributors
prefect-dbt
prefect-docker
prefect-gcp
prefect-getting-started
prefect-integrations
prefect-kubernetes
prefect-recipes
prefect-server
prefect-ui
random
show-us-what-you-got
Powered by
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
3 Views
#prefect-community
Join Slack