[TIP] Unittest Changes

Jonathan Lange jml at mumak.net
Sun Jul 20 22:36:00 PDT 2008


On Mon, Jul 21, 2008 at 3:22 PM, Christoph Zwerschke <cito at online.de> wrote:
> Jonathan Lange schrieb:
>  > The aim is to incorporate improvements to unittest that have stood the
>  > test of time in real projects, rather than to come up with blue-sky
>  > features.
>
> I think the new features of JUnit4 should also be taken into
> consideration (see e.g. http://www.devx.com/Java/Article/31983)
> for a remake of pyUnit. For instance, I sometimes missed setup and
> teardown methods that are executed only once per Test class.
>

Perhaps. It's worth treading carefully where Shared Fixtures[1] are
concerned. They tend to lead to Erratic Tests[2] and Fragile Tests[3].

Twisted added setUpClass and tearDownClass to Trial and they have
caused us nothing but grief. To be fair, they were added before
classmethod was added to Python, which caused much of the pain.

I would much rather see something like testresources[4] become
standard, but only after it gets more use.

jml

[1] http://xunitpatterns.com/Shared%20Fixture.html
[2] http://xunitpatterns.com/Erratic%20Test.html
[3] http://xunitpatterns.com/Fragile%20Test.html
[4] http://launchpad.net/testresources



More information about the testing-in-python mailing list