[Tutor] Where should unit test files go in a project directory structure and some related questions?
akleider at sonic.net
Sun Aug 16 17:41:45 CEST 2015
On 2015-08-16 01:28, Alan Gauld wrote:
> Here is my default structure
> - doc project documents: contracts reqs, designs, test specs etc
> - man(*) user docs
> - bin(*) the master exe or main.py type files
> - lib(*) the shipping libraries
> - src the code
> -- lang folder per language used - sql, python, C, bash, etc
> --- lib modules/packages - subfolder per package
> --- test test code - sub-tree under this, depends on test tools.
> --- tools tools used but not shipped - db load/reset etc
> --- main folder in some languages, a file in others
Assuming the above structure and further assuming that your python test
suite is under test,
how do you arrange to import code that is under main?
I have only been able to figure out how to import code that is at the
same or lower level in the file structure.
If one's test code was in --- test/test.py, an import of --- main or
main/mycode.py would have to 'find' the latter by traveling up the tree
to test and then over to main, or over to main and then down to
I've not been able to do that. Is there a way?
More information about the Tutor