dimanche 10 avril 2016

pytest find non-python files in a differenet directory

I have a file structure:

|--global_folder
|---------custom_folder
|----------------base.txt
|---------test_folder
|----------------test_file.py

I want to import(use the content of the file) the base.txt file in the test_file.py .
What is the most appropriate way to do this , so that when i execute py.test in the global_folder and when i execute py.test test_file.py in the test_folder , it doesn't throw any errors?
Do I have to manipulate with the sys.path ?

Aucun commentaire:

Enregistrer un commentaire