Although arguments can be made for either organization structure, I feel that following the lead of the Django project, and separating the tests from the rest of the source code is much cleaner. Doing so clearly differentiates between the actual code of the project and the testing of that code (which can be thought of as a consumer of the project code). Also, make sure not to call the directory "test" as there is an internal Python module named test.
MyProject/ setup.py myproject/ __init__.py somemodule.py somepackage/ __init__.py foo.py docs/ tests/ runtests.py unittests/ __init__.py ... integrationtests __init__.py ...
I'm sure that there are many who will say that I'm wrong, but at least I can fall back on the fact that Django does it this way. If you don't believe me, just check out their source code.
No comments:
Post a Comment