Q on Pytest using `prefect_test_harness` fixture: ...
# ask-community
m
Q on Pytest using
prefect_test_harness
fixture: How to unit test with the fixture, when flows depend on blocks? Do I have to register all my blocks for the tests? For secret key blocks this is very inconvenient.
n
in my experience, its often easiest to have a fixture for the block and mock out the network call that you're using the block for - if you have a more specific case in mind, feel free to share here
m
Awesome, thanks for reply! Many tests are flows that call a DB. At some point my test environment (with different blocks than production, different DB, etc) is drifting away from the application I want to apply tests on. Very good insight in your comment though. Maybe I should be testing smaller units individually.