Fix Flakehell on tests + fix legacy removal on tests
Created by: PhilipVinc
This PR fixes (mostly auto+ some manual work) all issues raised by flakehell on the tests.
This PR also fixes a few more tests that would fail once we remove legacy (mainly because we were doing hi.random_state(3)
to generate 3 states, but now that will fail as we will require the first argument to be a PRNGKey.