How to organize test cases with PyUnit
Roy Smith
roy at panix.com
Sun Jul 7 16:53:23 EDT 2002
Peter Hansen <peter at engcorp.com> wrote:
> We put all of ours in a subdirectory called "unit" [...] we similarly
> use "_user" or "_accept" at the end
That makes sense.
> As for getting out of sync -- this is not a problem if you always
> write the test code before the application code
I know that's the way it's supposed to happen, but somehow we never seem
to quite reach that particular state of bliss :-)
> We modify PYTHONPATH to include ".." first and run from the folder
> containing the tests. Then the "import module" is all we need.
Seems reasonable.
> By the way, you might encounter problems with "module-test.py" as
> a file name at some point... you couldn't import it, for example.
> Use underscores instead of hyphens...
Good point; I hadn't thought of that. We've been using the
"filename-test" convention with our TCL stuff, and I brought it over
from that.
Thanks for the input.
More information about the Python-list
mailing list