diff --git a/kwant/tests/test_qsymm.py b/kwant/tests/test_qsymm.py
index 7f7ce9291777cb8d9731d8f4925a212643915672..99739993e3cdf09e0bfcf7466c6ceba0a6fddce5 100644
--- a/kwant/tests/test_qsymm.py
+++ b/kwant/tests/test_qsymm.py
@@ -366,8 +366,8 @@ def test_consistency_kwant():
                      np.exp(1j*k)*model_kwant_hop.T.conj()) # As in kwant.Bands
     h_model = Ham.lambdify()
     wsyst = kwant.wraparound.wraparound(model_syst).finalized()
-    for _ in range(20):
-        k = (np.random.rand() - 0.5)*2*np.pi
+    ks = np.linspace(-np.pi, np.pi, 21)
+    for k in ks:
         assert allclose(h_model_kwant(k), h_model(coeffs[0], coeffs[1], k))
         params['k_x'] = k
         h_wrap = wsyst.hamiltonian_submatrix(params=params)