<div dir="ltr"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 10, 2018 at 12:34 AM Ned Batchelder &lt;<a href="mailto:ned@nedbatchelder.com">ned@nedbatchelder.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Can you say more about why you want the tests to run in a particular <br>
order?  </blockquote><div><br></div><div>I like to run tests going from common/core modules to more specific ones. That basically means ordering modules based on its `import`s.<br><br>i.e. If bar.py imports foo.py, test_foo.py should be tested before test_bar.py.<br><br>The main advantage is that a change in foo.py might break several tests... usually the most significant test failure you care is on test_foo.py.<br>This way you can always look at the first failing test.<br>It will be faster to see a failure and probably give you the best assertion error.<br>Often fixing this first test fixes all, or at least helps you move forward in the right direction.<br><br>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.<br>It works well as long as your imports are not messed with circular imports...<br><br><br>[1] <a href="https://github.com/pytest-dev/pytest-incremental">https://github.com/pytest-dev/pytest-incremental</a><br><br>Regards,<br>  Eduardo</div></div></div></div>