[TIP] Where to put unit tests? (What to name subdirectory?)
barry at python.org
Wed Nov 12 16:45:48 PST 2008
-----BEGIN PGP SIGNED MESSAGE-----
On Nov 12, 2008, at 3:45 PM, C. Titus Brown wrote:
> On Wed, Nov 12, 2008 at 12:41:14PM -0800, Daryl Spitzer wrote:
> -> I apologize if this is a FAQ. I didn't find the answer (or
> -> in a quick search.
> -> Is there a convention for where to put unit tests?
> -> I favor putting them in a subdirectory named "UnitTests" (following
> -> Michael Foord's example in the Mock sources). That way I can
> -> separate the unit tests from integration tests or system tests.
> -> But a colleague states that the python stdlib's tests are in a
> -> subdirectory called "tests". Should I consider that a convention
> -> stick with it (in spite of its disadvantages)?
> That's how I do it; I believe both nose and py.test will discover
> under 'tests/', and I've seen it in other packages, too.
I really like putting doctests under a docs/ subdirectory because,
well that's their primary purpose in life, right? :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
-----END PGP SIGNATURE-----
More information about the testing-in-python