Resetting Mox mock after a single test

You don’t need to do that. The tests can run concurrently and you never know what order they will run in because order is randomized. Every test lives in its own beam process. Mock often can see what process was responsible for what chain of events and so if you do it right, changes you make to the mocks are contained to your test process and its friends (for some value of “friends”) and the whole universe of that testing setup is thrown away at the end of the test.

This is what makes elixir testing awesome, btw, When you get really good you can run all of your tests (even integration tests that escape the BEAM) concurrently without stomping on each other’s view of what the VM should look like.