diff --git a/src/sage/algebras/lie_algebras/representation.py b/src/sage/algebras/lie_algebras/representation.py index bebd13a65c7..685b6860e87 100644 --- a/src/sage/algebras/lie_algebras/representation.py +++ b/src/sage/algebras/lie_algebras/representation.py @@ -87,6 +87,8 @@ def _test_representation(self, **options): tester = self._tester(**options) S = tester.some_elements() elts = self._lie_algebra.basis() + if elts.cardinality() == float('inf'): + elts = list(elts.some_elements()) from sage.misc.misc import some_tuples for x, y in some_tuples(elts, 2, tester._max_runs): for v in S: