-
Notifications
You must be signed in to change notification settings - Fork 132
Description
tests [..] should be placed in a submodule of funniest. so that they can be imported, but won't pollute the global namespace.
There's a good case to be made that tests should not live inside your package, but instead inside a separate top-level tests/. This is how one of the PyPA core devs does it. This is also what https://packaging.python.org/tutorials/packaging-projects/ (which makes sense, it's written by the same group). The reason for this is it lets you cull tests from your binary distribution, since people installing from binary almost never care to run your tests or have them take up space -- though you need to go out of your way to make sure to re-include them in your sdist, but that's a one-line addition.
https://stackoverflow.com/questions/61151/where-do-the-python-unit-tests-go covers the three main options:
- Side-by-side your code (and says they prefer it; to be honest, so do I, it feels more right)
- In a top level tests/
- In a tests/ subpackage
The current recommendation in this doc is for 3. PyPA thinks you should use 2. What are your thoughts?