0

I'm trying to test a function i wrote, from tests directory in the src folder. I've importing function like this:

from src.func import function

Error:

ModuleNotFoundError: No module named 'src'

I've even tried relative imports, like this:

from .. import func

error:

from .. import func
ImportError: attempted relative import with no known parent package

here is my dir structure, which may be helpful:

.
└── src
    ├── func.py
    ├── __init__.py
    └── tests
        ├── __init__.py
        └── test_func.py

I seriously don't get whats going wrong here, so any help is appreciated.

Thanks

default-303
  • 311
  • 1
  • 2
  • 11

0 Answers0