[TIP] alphabetical order in testing

holger krekel holger at merlinux.eu
Wed Jan 20 09:22:18 PST 2010


On 20, 2010 at 09:34 -0500, Alfredo Deza wrote:
>> On Wed, Jan 20, 2010 at 5:42 AM, holger krekel <holger at merlinux.eu>
>> wrote:
>> py.test runs tests in the order in which they appear in the file and i am
>> considering marking a test case/class as being "incremental", i.e. skip/fail
>> tests after the first tests fails.
>>
> Even worse, why (if alphabetical is the correct way) test frameworks like
> py.test do them in a different way? This adds a whole layer of confusion to
> someone that wants to get started correctly. However I do agree that it is
> good to have options and different ways of doing things. But I also support
> conventions.

IMO there is no "correct" way regarding order of calling test functions. 
People even have written randomizers so that implicit (and often unintended) 
sife effects of test functions depending on other test functions are uncovered.  
If you are starting to get into testing with Python, i'd join Michael and 
others here and recommend to not depend on test ordering at all. 

holger



More information about the testing-in-python mailing list