diff --git a/dune/xt/la/test/matrices.py b/dune/xt/la/test/matrices.py
index a0ece9d86351d49b3b0eb2d19ffad13c930a0661..0de186451d29587b1022027a2ddc78c5c8c23025 100644
--- a/dune/xt/la/test/matrices.py
+++ b/dune/xt/la/test/matrices.py
@@ -7,7 +7,7 @@ def matrices(cache):
 
   if codegen.have_eigen(cache):
       mat.extend(['EigenRowMajorSparseMatrix', 'EigenDenseMatrix'])
-  if codegen.have_eigen(cache):
+  if codegen.have_istl(cache):
       mat.append('IstlRowMajorSparseMatrix')
   return mat
 
diff --git a/dune/xt/la/test/solver.py b/dune/xt/la/test/solver.py
index e7aab9757a25cd71d4652469aca851268d94a2b9..7e294ce7a54da532113a865b1670e0ffe53ff655 100644
--- a/dune/xt/la/test/solver.py
+++ b/dune/xt/la/test/solver.py
@@ -1,6 +1,6 @@
 
 from matrices import latype
-from dune.xt.codegen import typeid_to_typedef_name as safe_name
+from dune.xt.codegen import have_eigen, have_istl, typeid_to_typedef_name as safe_name
 
 
 types = [f.split('_') for f in ['CommonDenseMatrix_CommonDenseVector_CommonDenseVector_complex',
@@ -21,4 +21,13 @@ def test_tuple(args):
         f = 'std::complex<double>'
     return (safe_name('{}_{}_{}_{}'.format(o, r, s, f)), latype(o,f), latype(r,f), latype(s,f))
 
-testtypes = [test_tuple(item) for item in types]
\ No newline at end of file
+
+def type_ok(t):
+    if sum(['Eigen' in x for x in t]):
+        return have_eigen(cache)
+    if sum(['Istl' in x for x in t]):
+        return have_istl(cache)
+    return True
+
+
+testtypes = [test_tuple(item) for item in types if type_ok(item)]