TST: misc. clean up for sparse tests

May depend on PR #3076. Removing the call to `np.random.rand` on line 2349 triggered the flaky test for me.