Use np.RansdomState in tests

This is relevant mostly for tests of iterative algorithms.