[TIP] Advice on location of tests modules
gokoproject at gmail.com
Thu Feb 27 15:03:40 PST 2014
I am not sure if I understood your question entirely, so correct me if
This is the source code I supposed:
I've looked at the structure a bit and found that you currently have tests
under each product/package (for example,
I believe this means tests is also included in the package installation
(when you run setup.py)
I prefer not to do that. I prefer to have my test folder next to setup.py.
This means I shouldn't be importing bhdashboard.tests.test_xxxx and there
is no reason to import that.
Should you combine all tests in a single directory? Examples:
and so on
I wouldn't do that. Each python package (I go by product1, product2,
product3 here) should have its own tests directory (sits next to setup.py).
If two packages share a lot of test utilities scripts (I call them test
drivers), consider making those utilities into separate python package.
That's just me. Most of my projects will end up in some PyPI data store
(public or private) so I have a good reason to keep test folder separate.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python