Slightly off-topic, where do people like to put there tests (unit tests)
in a python package directory structure? Using the example in the
Python documents:
python_pkg/
setup.py
sound/ Top-level package
__init__.py Initialize the sound package
formats/ Subpackage for file format conversions
__init__.py
wavread.py
wavwrite.py
...
effects/ Subpackage for sound effects
__init__.py
echo.py
surround.py
reverse.py
...
filters/ Subpackage for filters
__init__.py
equalizer.py
...
Would you have one test folder in python_pkg/ or sound/ with all the
tests. Or do you have module specific tests with the modules. Or a
combination.
In general, I suppose this is project specific. Some projects don't
benefit from a package/module organization. But there are some
technical constraints, e.g. if the test access as a package or
individual modules.
I usually end up with something like:
python_pkg/
setup.py
sound/
__init__.py
formats/
__init__.py
wavread.py
wavwrite.py
test_wav.py
...
effects/
__init__.py
echo.py
surround.py
reverse.py
test_echo.py
test_surround.py
...
filters/
__init__.py
equalizer.py
...
test/
test_sound.py
test_echo.py
I have top-level, system tests, and module tests.
Regards,
Chris
|