I put my pytest tests in a sub directionary called tests, in my parents directory, I have all my file in src, I try to import them using relative import but it doesn't work:
.
├── src
│ ├── __init__.py
│ └── app.py
├── tests
│ ├── __init__.py
│ └── myTests.py
└── main.py
In myTests.py
from ..src import app
This is the error I get:
from ..src import app
E ImportError: attempted relative import beyond top-level package
I am trying to call pytest from the top level with main.py in it:
python -m pytest -vv -x
How do I include from parent's sub directory?