Re: unittest: Calling tests in liner number order



"Diez B. Roggisch" <deets@xxxxxxxxxxxxx> wrote:

I agree that tests should not depend on each other, but sometimes it's
still useful to have the tests run in a certain order for reporting
purposes.

Then sort your report. Seriously. A test-outpt shoud be in a way that
delimits individual testresults in a way that makes them easily
extractable. Then if you want them to be ordered for e.g. diff'ing -
sort them.

Diez

Here's an example of why *running* tests in order can make sense.

You could have a bunch of tests of increasing complexity. The first bunch
of tests all run in a few seconds and test some basic functionality. From
experience, you also know that these are the tests that are most likely to
fail as you port to a new environment.

There's also some tests which take a long time to run. If the basic stuff
that's being tested by the earlier tests doesn't work, there's no way these
tests could pass, but they still take a long time to fail.

It's really handy to have the simple tests RUN first. If you see they
fail, you can cancel the rest of the test run and get on with fixing your
code faster.

It's a good thing to make it easy to do things the right way, and difficult
to do things the wrong way. The danger is when you let your pre-conceived
notions of right and wrong trick you into making it difficult to do things
any way but YOUR way.

So far, the strongest argument I've seen against the OP's idea is that it's
not portable to Iron Python. That's a legitimate argument. All the rest
of the "You're not supposed to do it that way" arguments are just religion.
.



Relevant Pages

  • Re: Report progess during black box process
    ... Create the DataSource in a BackGroundWorker and make sure the DataSource is ... afterwards sort it in the BackgroundWorker. ... I am reporting to the user the progress while rows are added, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: An odd sort requirement - data munging
    ... files that range from several dozen rows deep to almost 1M rows deep. ... are actually the number you want to sort. ... Please note that the Academic year crosses year boundries, i.e., from ... 2007 to 2008, while the Reporting year crosses month boundries, i.e., ...
    (comp.lang.perl.misc)
  • Re: Why is device_create_file __must_check?
    ... In the case of the windfarm driver, the sysfs files are reporting ... So just some cheesy printk would do in ... that sort of situation, I guess. ...
    (Linux-Kernel)
  • Re: INSM......Bought more
    ... What do you do when you make a mistake. ... Reporting people just because you "think" they did something wrong is ... That sort of behaviour hurts too many innocent people. ... penny stocks and the same stock from four or more purported "sources". ...
    (rec.aviation.piloting)
  • Re: Report progess during black box process
    ... I am reporting to the user the progress while rows are added, ... reported until the sort finishes, which can take more than a minute ... If you read the documentation on BackgroundWorker (see ReportProgress ...
    (microsoft.public.dotnet.languages.csharp)