Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100252

Re: python unit test frame work

From Cameron Simpson <cs@zip.com.au>
Newsgroups comp.lang.python
Subject Re: python unit test frame work
Date 2015-12-11 14:34 +1100
Message-ID <mailman.128.1449805473.12405.python-list@python.org> (permalink)
References <85zixh4r6k.fsf@benfinney.id.au>

Show all headers | View raw


On 11Dec2015 14:09, Ben Finney <ben+python@benfinney.id.au> wrote:
>Cameron Simpson <cs@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@zip.com.au>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python unit test frame work Cameron Simpson <cs@zip.com.au> - 2015-12-11 14:34 +1100

csiph-web