Re: unittest: Calling tests in liner number order
- From: André <andre.roberge@xxxxxxxxx>
- Date: Sat, 24 May 2008 06:22:27 -0700 (PDT)
On May 24, 10:12 am, Roy Smith <r...@xxxxxxxxx> wrote:
In article
<84ff733a-e364-437d-9b5d-d8bb14cc6...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
John Roth <johnro...@xxxxxxxxx> wrote:
Does the following patch has a chance of being introduced in the
standard python distribution?
I certainly hope not!
I think you're being overly negative here. Antoon went to the trouble to
read the sources and post a diff. At the very least, he deserves a more
polite response.
But, more than that, I think Antoon's idea has some merit. I understand
that the mantra in unit testing is that the tests should be able to be run
in any order. Still, it's the job of a library package to make it easy to
do things, not to enforce policy. If somebody (for whatever reason) has a
need to run their tests in a certain order, why is it our job to make it
hard for them to do that?
In fact, unittest.defaultTestLoader *already* sorts the tests into
alphabetical order by their name. So, if somebody wanted to get the tests
run in order, they could just name their tests "test0001", "test0002", etc..
In fact, I've done that in the past when I had some (long forgotten) reason
why I wanted to run a bunch of things in order. Allowing the tests to be
sorted by line number order instead of by name just makes it a little
easier to do the same thing.
If somebody wants that functionality, and is willing to put in the effort
to write the code to do it, and contribute that back to the community, I
don't see any reason why it shouldn't be considered. It would have to be
done in a way that doesn't change the current behavior (perhaps by shipping
a subclass of TestLoader which users could use instead of the default).
I'm not saying that we *need* to include it, just that it's not such a bad
idea that it deserves responses like "I certainly hope not!"
I totally agree.
I can't relate to anyone that want to oppose a change that would give
more freedom to a programmer.
André
.
- Follow-Ups:
- Re: unittest: Calling tests in liner number order
- From: John Roth
- 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
- unittest: Calling tests in liner number order
- Prev by Date: PIPE stderr
- Next by Date: Re: unittest: Calling tests in liner number order
- 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
|
|