I am trying to package a software written in python for the first time and so I am now running tests through tox. The template was setup through cookiecutter. Then I added my code to sample and created a tests/ folder with a script that should test one method in the class contained under project_name.py
Unfortunately my test in tox always fails:
my package looks something like this
```
project
│
└───sample
│ project_name.py
│ save_.py
| data.pkl
| __init__.py
│
└───tests
settings.txt
test_project.py
```
The error that I am getting is the following
________________________________________ ERROR collecting tests/test_project.py _________________________________________
ImportError while importing test module'/home/user/Documents/project/tests/test_project.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_project.py:6: in <module>
import sample.project as pr
sample/project_name.py:12: in <module>
from save_ import Save
E ModuleNotFoundError: No module named 'save_'
I have already tried to add a new PYTHONPATH that points to the folder in which I have the different scripts for my software, but that didn't work.
I have also tried to change the names because I thought that perhaps the underscore at the end of the module name wasn't a valid python name.
I have looked for other solutions on stackoverflow but I couldn't find anything that solved my problem.
Thanks in advance for any help you may be able to provide!