While the unittesting philosophy is that tests can be ran in any order and it should pass, what if you’re implementing an API where there is no other means of communicating with a server… and you need to test a certain very basic feature (such as delete) before you can do more complicated tasks? Is ordering the tests then reasonable?
If so, how can I do it with python’s unittest module?
You already seem to realise that your unit tests should be independent. The only other reason I can see that you want to run the tests in some fixed order is that you want to stop running the suite if an early test fails. To do that, you can use the command-line option
By the way, the tests are run in alphabetical order:
(docs)