I've read multiple articles and questions on StackOverflow and was wondering why no one uses the following structure for unit tests in Python:
MyProject/
main/
module1/
my_file.py
test/
module1/
test_my_file.py
What I've read is that you either:
Put
test_my_file.pyin the same directory asmy_file.py:MyProject/ module1/ my_file.py test_my_file.pyPut
test_my_file.pyin a directory namedtestin the same directory asmy_file.py:MyProject/ module1/ my_file.py test/ test_my_file.py
Notes:
- I come from a Java world: having unit test code at the same place as production code feels weird to me.
- I'm very new to Python: there's probably some obvious reason I'm missing here. (My first guess would be that it has something to do with modules)