Skip to content

Unit testing @task decorated functions without active Flow context. #4010

Answered by zanieb
skwzrd asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @skwzrd -- the typical pattern here is to call my_task.run() in your tests, for example

@task
def foo(arg1, arg2):
    return arg1 + arg2

def test_foo():
   assert foo.run(1, 2) == 3

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by skwzrd
Comment options

You must be logged in to vote
2 replies
@bennnym
Comment options

@mbopfNIH
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants