[TIP] Tipp: Ordering Test Files

RonnyPfannschmidt opensource at ronnypfannschmidt.de
Wed Oct 10 00:45:45 PDT 2018


Hi Daniel,

just to throw in my personal oppinion,

the ideal case would be a tool that is able to order tests based on
layering and dependencies that are expressed in the "system under test"
so the different unit and integration layer tests would be ordered by
independence and/or dependence on different parts of the system

even more so if the tooling would collect and categorize based on
failures on would tell the smallest test that triggers it for the
correction iteration feedback

in general i would prefer tooling that helps to create that layering and
to order tests based on it, over manually ordering tests and then at a
later point that ordering breaking down due to organic structural change

that being said - there is a short term gain in creating such an
explicit manual order that may very well be worth it for a range of
project setups,
as such - if you find the ordering of tests in the way you outlined
directly supports your development/testing productivity right now, its
very likely worth that efford on naming files.

Rest regards,

-- Ronny

Am 10.10.18 um 08:39 schrieb Daniel Knüttel:
>> I have written a pytest plugin [1] that sort you tests based on
>> imports, and also skip tests modules that are not affected by
>> changes.
>> It works well as long as your imports are not messed with circular
>> imports...
>>
> That is cool. It is not as explicit as my way but it will do the same
> job. I will definitely give it a try.



More information about the testing-in-python mailing list