[py-dev] Fwd: Speed of py.test compared to unittest

Maciek Fijalkowski fijal at genesilico.pl
Wed Nov 15 12:30:47 CET 2006


Carl Friedrich Bolz wrote:

>Pierre Rouleau wrote:
>  
>
>>On 11/14/06, Carl Friedrich Bolz <cfbolz at gmx.de> wrote:
>>    
>>
>>>I am not quite sure I buy that argument since py.test tells you the time
>>>that the test itself took (if you use the -v argument) or that all tests
>>>together take (at the end of each test run). As far as I remember, these
>>>times don't include any startup times. Yes, wall clock time of the whole
>>>test run is quite a bad measure, but you don't have to use it anyway.
>>>
>>>Cheers,
>>>
>>>Carl Friedrich
>>>
>>>      
>>>
>>I didn't realize that the time of *each* test is shown when the -v
>>option is used.  Thanks for pointing that out.
>>    
>>
>
>you're welcome :-)
>
>Note that I didn't mean to imply that it isn't worthwhile to make
>py.test startup time smaller. it's definitely a good thing to do, since
>testing should have low overhead.
>
>Cheers,
>
>Carl Friedrich
>_______________________________________________
>py-dev mailing list
>py-dev at codespeak.net
>http://codespeak.net/mailman/listinfo/py-dev
>  
>
I've profiled it a bit. Right now (for me) your tests are about 3x 
slower that unittests. It still can be improved somehow.

Btw: Tests are unfair, cause collection encounters 5k tests for py.test 
and 13 for unittests, if you rewrite it so they'll be equal it would be 
better. It's not good excuse anyway ;-)

I'll try to work a bit more on it, but I guess achieving 2x in this 
particular case would be enough. If you still encounter massive 
slowdowns in different enviroments, do not hesitate to contact us.

Cheers,
Maciej Fijalkowski




More information about the Pytest-dev mailing list