I'm trying to run pytest on some functions I've written in Airflow. I'm using Python 3.8, btw.
The folder structure is
airflow
-- dags
-- includes
-- common
-- functions.py
-- tests
-- test_functions.py
I tried from includes.common.functions import functionA, functionB
, but kept getting the error ModuleNotFoundError: No module named 'functions'
.
If I try from dags.includes.common.functions import functionA, functionB
, I get ModuleNotFoundError: No module named 'dags'
.
I've tried python -m pytest tests
in the airflow
folder, same import error.
I'm not very familiar with importing modules, and would appreciate any help in how to solve this error.