[pypy-dev] Improved Unit Test Framework

Peter Hansen peter at engcorp.com
Sun Oct 19 20:09:42 CEST 2003


(Sorry, Holger... I first sent this to you directly by accident, rather
than just to the mailing list.)

holger krekel wrote:
> 
> [Peter Hansen Sun, Oct 19, 2003 at 09:14:43AM -0400]
> > holger krekel wrote:
> > > >  - improvements to unittest itself
> >
> > Just what would those be?  I still haven't heard a single useful
> > improvement.  There must be some (at least, that's obviously what
> > a lot of people feel), but what are they?
> 
> ok, here a few possible improvements for starters (i have a lot more in
> mind :-)
> 
> - beeing able to provide a function that executes a test-method
>   (today you have to replicate all the boilerplate in TestCase.__call__
>   etc.pp.)

Why do you need to do that?  Or maybe I should say, can't you already
do that?  If you have a TestCase, I think you just call .run or something
on it, same as when you specify a single class and (optionally) a test
method name on the command line.  I frequently run a single test using
our framework wrapper, which just stole code from the existing runner
in unittest.

> - beeing able to raise e.g. TestSkip Error to indicate that a test
>   should not be run with the current setup. (You can't alway tell
>   that offhand in setUp).

What does this do that raise TestSkipError (after defining it)
would do not do?  Continue running other tests?  Seems like a 
property of the test runner, not the unittest side of things 
(assuming a new test runner, as we are by making the distinction 
into two categories, I think).

> - allow providing extra options to the cmdline-interface
> 
> - plan for/do other user-interfaces (web-driven, pygame, whatever :-)
> 
> - provide means (a TestConsole) to easily get a list of failed tests
>   (interactively), keep the testing-process alive and repetitively redo
>   the failed tests. Or save off the info to some file and reload it
>   on rerunning the test.

These are all properties of the test runner, aren't they?  The
existing unittest has its own version of this stuff, but I got
the impression you were already accepting that a different runner
would be needed.

-Peter
-------------- next part --------------
An embedded message was scrubbed...
From: Peter Hansen <peter at engcorp.com>
Subject: Re: [pypy-dev] Improved Unit Test Framework
Date: Sun, 19 Oct 2003 14:07:42 -0400
Size: 2656
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20031019/7c6d7430/attachment.mht>


More information about the Pypy-dev mailing list