I have a Python3 project arranged as follows:
C:\automation\framework\constants.py
C:\automation\tests\unit-tests\test_myunittest.py
In my unit test, I'm trying to call methods in framework folder, which has the required init.py file At the start of my unit test, I have the following imports:
import pytest
from framework import constants
When I call pytest, it throws the following error:
ModuleNotFoundError: No module named 'framework'
How do I fix this?
tests\unit-tests. How is it to know that two directories up is where the framework is located? Either change the working directory, or set thePYTHONPATHenvironment variable.__init__.pynotinit.py