[TIP] How do I run the same test on many different classes?

Olemis Lang olemis at gmail.com
Mon Dec 14 08:47:07 PST 2009


On Mon, Dec 14, 2009 at 11:29 AM, John Arbash Meinel
<john.arbash.meinel at gmail.com> wrote:
> Olemis Lang wrote:
> ...
>
>>>> I believe that the Bzr guys (?) do this by copying TestCase classes.
>>> https://edge.launchpad.net/testscenarios
>>>
>>> This is a modular form of what we do in bzr.
>>>
>>> TaskN are implementations of Task to be injected into the TestTask
>>> tests.
>>>
>>
>> I wanted to know something about this approach vs cloning the test suite :
>>
>> Q:
>>   - In this case d'u use the same test case instance in order to
>> perform the test ?
>>
>> If you do that then (considering the outcomes recorded in the
>> TestResult instance ;o) things have two meanings IMO :
>>
>>   - The same test case was run and failed many times (what I think
>>     that happens in that approach ... CMIIW)
>>   - A different test case was run for each concrete class but they all
>>     perform the same assertions (what happens when cloning the test suite)
>>
>> IMO I found that the later was more accurate since instances of
>> TestCase recorded in test results may contain important data useful
>> for post-mortem analysis (and I needed that considering the particular
>> requirements I had once upon a time ;o) .
>>
>> Looking forward to your reply
>>
>
> I don't know how testscenarios does it, but in bzr we 'deepcopy' the
> test and change the id. So you end up with:
>
> tests.TestCase.test_one(Task1)
> tests.TestCase.test_one(Task2)
> tests.TestCase.test_bar(Task1)
> tests.TestCase.test_baz(Task2)
> ...
>

ok ... I just asked because I supposed that the same test case
instance was reused after reading the overview page , and I didn't
find a download link :-/

No further comments .

> John
> =:->
>

=|:^)x-

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Automated init.  -
http://bitbucket.org/osimons/trac-rpc-mq/changeset/e122336d1eb2/



More information about the testing-in-python mailing list