How to organize test cases with PyUnit

John Roth johnroth at ameritech.net
Sun Jul 7 19:01:59 EDT 2002


"Roy Smith" <roy at panix.com> wrote in message
news:roy-482A07.16532307072002 at reader2.panix.com...
> 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 :-)

Well, that's because the only people I know who always
do this are XP people practicing test driven development. Otherwise,
it's simply more interesting to jump right into the code, and hammer
on it later to make sure it works.

> > 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