Below is the folder structure
--src
init.py
game.py
player.py
board.py
--tests
init.py
test_board.py
in my test_board.py I have the following code.
import unittest
import src.player
import src.board
import src.game
class TestBoard(unittest.TestCase):
def test_space_occupied(self):
...
For some reason I am getting module = __import__(module_name) ^^^^^^^^^^^^^^^^^^^^^^^ error.
If it help, I also have setup.py above the src and the tests folder and have this setup.
packages=find_packages(where='src'), # This function automatically finds all packages in the 'src' directory.
package_dir={'': 'src'}, # This specifies that the packages are located under the 'src' directory.
Why can't my unit test simply import modules from the src folder?