Jai P04/20/2022, 12:58 AM
Zanie04/20/2022, 1:07 AM
Jai P04/20/2022, 1:26 AM
==================================================================================== test session starts ===================================================================================== platform darwin -- Python 3.10.2, pytest-7.1.1, pluggy-1.0.0 rootdir: /path/to/dir plugins: anyio-3.5.0 collected 10 items tests/test_flow.py .......... [100%] ==================================================================================== 10 passed in 11.09s =====================================================================================
Zanie04/20/2022, 1:35 AM
Jai P04/20/2022, 1:41 AM
expose this in the near futureyou're talking about the higher performance lower level reset? the session scope is just a pytest change right?
Zanie04/20/2022, 1:44 AM
Jai P04/20/2022, 1:49 AM
Zanie04/20/2022, 1:52 AM
object that gives you full introspection of all of the task and flow runs that it created, their states, number of retries, return values, etc. so you can make the assertions you want.
per test is slow”
Jai P04/20/2022, 1:59 AM
davzucky04/20/2022, 12:31 PM
Zanie04/20/2022, 2:40 PM
Danny Sepler04/20/2022, 6:00 PM
is this an ok approach? would it make sense to make a lil helper function for this? if this is ok, i could add it to your testing docs!
# my_task.py from prefect import task @task def double_value(value: int) -> int: return value * 2 # test_my_task.py from my_task import double_value def test_double_value(): assert double_value.__wrapped__(1) == 2
Zanie04/20/2022, 6:08 PM
Danny Sepler04/20/2022, 7:39 PM
is even clearer than wrapped. thanks! yeah a few of our tasks won't rely on prefect behavior, so this is nice for those could be a nice addition to these docs, if you'd like me to diff it in?
Zanie04/20/2022, 8:18 PM
davzucky04/20/2022, 10:57 PM