[Python-Dev] Unit testing (again)

Fredrik Lundh fredrik@pythonware.com
Tue, 13 Feb 2001 17:32:00 +0100


barry wrote:
> Especially because requiring the snippets to be in strings means
> editing them with a Python-aware editor becomes harder.

well, you don't have to put *all* your test code inside
the test calls...   try using them as asserts instead:

    do something
    do some calculations
    do some more calculations
    self.test_bool("result == 10")

> And at least there, I can for the most part just cut-and-paste the
> output of my interpreter session into the docstrings.

cutting and pasting from the interpreter into the test
assertion works just fine...

Cheers /F