Skip to content

Commit

Permalink
ModulesWithBasis.ElementMethods._test_monomial_coefficients: Allow mo…
Browse files Browse the repository at this point in the history
…nomial_coefficients to raise NotImplementedError
  • Loading branch information
Matthias Koeppe committed May 27, 2024
1 parent 3e914e8 commit 1f69514
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sage/categories/modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ def monomial_coefficients(self, copy=True):

def _test_monomial_coefficients(self, **options):
r"""
Test that :meth:`monomial_coefficients` works.
Test that :meth:`monomial_coefficients` works correctly if it is implemented.
INPUT:
Expand All @@ -1490,7 +1490,10 @@ def _test_monomial_coefficients(self, **options):
tester = self._tester(**options)
base_ring = self.parent().base_ring()
basis = self.parent().basis()
d = self.monomial_coefficients()
try:
d = self.monomial_coefficients()
except NotImplementedError:
return
tester.assertTrue(all(value.parent() is base_ring
for value in d.values()))
tester.assertEqual(self, self.parent().linear_combination(
Expand Down

0 comments on commit 1f69514

Please sign in to comment.