Re: unittest: Calling tests in liner number order
- From: John Roth <johnroth1@xxxxxxxxx>
- Date: Sun, 25 May 2008 06:17:58 -0700 (PDT)
On May 24, 7:22 am, André <andre.robe...@xxxxxxxxx> wrote:
I can't relate to anyone that want to oppose a change that would give
more freedom to a programmer.
André
Well, you can already do that. Or anything else you want. It's not all
that difficult to change the algorithms in the unittest package
_without_ patching the code. How to do it could be better documented,
granted.
For my major project (Python FIT) I've got my own test case extraction
mechanism that doesn't depend on patching the code. It lets me use any
name I want - that is, it doesn't depend on any kind of pattern match.
(It also avoids looking in subclasses for tests.) I find the naming
freedom to be quite useful in thinking about the test case.
I really don't care what the OP does in his own projects. My objection
is that, if it goes into the standard library, is that it passes a
signal that it's good practice to allow dependencies between tests. It
most definitely is _not_ good practice.
I like the technique of looking at the line numbers to get the
declaration order; it ought to be documented somewhere.
The proper place for this is either a recipe (
http://aspn.activestate.com/ASPN/Cookbook/Python/ ) or a note in the
documentation with a caveat that it's not good practice, but it may be
useful in some circumstances.
John Roth
.
- Follow-Ups:
- Re: unittest: Calling tests in liner number order
- From: Roy Smith
- Re: unittest: Calling tests in liner number order
- References:
- unittest: Calling tests in liner number order
- From: Antoon Pardon
- Re: unittest: Calling tests in liner number order
- From: John Roth
- Re: unittest: Calling tests in liner number order
- From: Roy Smith
- Re: unittest: Calling tests in liner number order
- From: André
- unittest: Calling tests in liner number order
- Prev by Date: Re: need some help in serving static files inside a wsgi apps
- Next by Date: Coverage checker: Coverage.py or pycover or ?
- Previous by thread: Re: unittest: Calling tests in liner number order
- Next by thread: Re: unittest: Calling tests in liner number order
- Index(es):
Relevant Pages
|