DEV Community

Discussion on: Dead Simple Python: Project Structure and Imports

Collapse
 
mkaut profile image
mkaut

Good point, thanks.

So, in your approach, how do you import, let's say game_item.py from test_game_item.py?
And does it then have to be run from a specific folder (omission-git, omission-git/omission/, or omission-git/omission/tests) or does it work from all the above?

Thread Thread
 
codemouse92 profile image
Jason C. McDonald

Within omission/tests/test_game_item.py, I would import that other module via...

import omission.game.game_item

I always run python -m omission or pytest omission from within omission-git.