jeudi 12 juillet 2018

how to import a fucntion from parent directory into test directory

I am trying to import a function from the directory in the same project. how can i do that ?

.|____project/
 |     |_____src/
 |     |        |____myproject/
 |     |        |     | __init__.py
 |     |        |     |____funtion.py
 |     |_____test/
 |     |        |___ testmyproject.py
 |     |        |____data/
 |     |                 |___testdata

How can i import the the file function.py or the functions in the function.py file in my test/testmyproject.py to test the fucntions? i am not able to import the module from function.py

Aucun commentaire:

Enregistrer un commentaire