python unit test frame work

Cameron Simpson cs at zip.com.au
Thu Dec 10 22:34:44 EST 2015


On 11Dec2015 14:09, Ben Finney <ben+python at benfinney.id.au> wrote:
>Cameron Simpson <cs at zip.com.au> writes:
>> First, as Ben remarks, if one test _depends_ on an earlier one then it
>> isn't a real unit test.
>>
>> On the other hand, if you simply have some simple tests followed by
>> more complex tests (I have several like this) you have two facilities
>> to help you.
>>
>> Firstly, I have observed that unittest tends to run tests in lexical
>> order
>
>Back on the first hand again, some unit test runners will deliberately
>*change* the order so your test cases are tested for independence.

That's fine. My tests are independent. But it is _handy_ that while building 
the tests and adding new tests that they are issued in a predictable order.

>Really, if your test cases depend on being executed in a particular
>sequence, the ‘unittest’ module is a poor fit.

Yes, but that is not the case for me, and quite possibly for the OP. Even if 
they aren't, he seems savvy and quick to learn and willing to adjust worse 
practice for better.

Cheers,
Cameron Simpson <cs at zip.com.au>



More information about the Python-list mailing list