https://prefect.io logo
a

Aaron Y

10/14/2020, 3:57 PM
Im trying to build in testing, but am having trouble importing the tasks. Also, is this a proper setup?
Copy code
from ... import ??

def test_say_hello():
    assert say_hello() == True
Copy code
PostProcessingTemplate/
  PostProcessingFlow.py
  PostProcessingTasks.py
  tests/
    test_PostProcessingTasks.py
j

josh

10/14/2020, 4:08 PM
Hi @Aaron Y could you give more details? I’m unsure of what you are attempting to do here. That setup looks correct where you would import your tasks from that PostProcessingTasks
a

Aaron Y

10/14/2020, 4:09 PM
the import isn't working
j

josh

10/14/2020, 4:11 PM
This isn’t anything Prefect related but more of a Python import pattern. I recommend reading up on how python handles imports like these πŸ™‚ https://stackoverflow.com/questions/16981921/relative-imports-in-python-3
βœ… 1
a

Aaron Y

10/15/2020, 8:00 PM
@josh idk man, still not working πŸ˜•
actually, got it
getting this error now?
j

josh

10/15/2020, 8:47 PM
Call
your_task.run()
to run the task directly πŸ™‚
a

Aaron Y

10/15/2020, 8:49 PM
so simple πŸ˜‚ thank you