I have written code that finds all of the tests that can be run in a package and gathers them into a single test suite. The only thing is that some of the tests are dependent on other tests already being run.
That might seem like bad test architecture but what I'm testing is the startup and shutdown of an application. So I have tests that makes sure everything comes to life appropriately, and then another set of tests that make sure that everything is cleaned up properly. Obviously though, I can't run the shutdown tests until the startup tests have finished.
Is it possible within Python's unittest to say "only run this test if the following is true, otherwise run other tests and come back to me"?
I understand that I could enforce this ordering by explicitly saying run the startup tests, now run the shutdown tests. But I'm using test discovery so that you can write more tests without explicitly having to invoke them so I am trying to avoid doing that.