[Python-checkins] r46603 - python/trunk/Lib/test/test_struct.py
Michael Hudson
mwh at python.net
Sun Jun 4 10:28:23 CEST 2006
"Tim Peters" <tim.peters at gmail.com> writes:
>>>> Author: martin.blais
>>>> Date: Fri Jun 2 15:03:43 2006
>>>> New Revision: 46603
>>>>
>>>> Modified:
>>>> python/trunk/Lib/test/test_struct.py
>>>> Log:
>>>> Fixed struct test to not use unittest.
>
> [Neal Norwitz]
>>> Shoot, I had hoped you would go the other way and convert all the old
>>> test cases to use unittest. :-)
>
> [Thomas Wouters]
>> Heh, my reaction was both "huh?" and "yay" at the same time. I thought
>> unittest was still preferred for the stdlib testsuite?
>
> That or doctest. What's definitely unwanted now is the original style
> of test that compares the whole test's output to an expected-output
> file in Lib/test/output/. Those can be horrid to figure out when they
> go wrong, and don't check at all when running regrtest with -v.
>
> unittest, and especially doctest, encourage breaking tests into small
> units. An example of neither is test_descr.py, which can be a real
> bitch to untangle when it fails.
Also, there is an advantage to have more structure to the tests; if
all of python's tests used unittest, my regrtest -R gimmickery would
be able to identify tests, rather than test files, that leaked and I'm
pretty sure that this would have saved me a few hours in the last
couple of years. Also, you can more easily identify particular tests
that fail intermittently. Etc.
Cheers,
mwh
--
<mitiege> dash: where do you go to school?
<tpck> mitiege: PSU
<mitiege> tpck: didn't faassen go there too?
-- from Twisted.Quotes
More information about the Python-checkins
mailing list