I finally found out the solution! I realized that once you put a __init__.py
under the testing repository, pytest will see this folder as a module. Hence, you don'y need to set up any environment variable manually and the structure will look like below.
.
├── src
│ └── module_a.py
└── tests
└── __init__.py
└── test_module_a.py