code: def test_issue_15791():
      class CrashingCodePrinter(CodePrinter):
          def emptyPrinter(self, obj):
              raise NotImplementedError
  
      from sympy.matrices import (
          MutableSparseMatrix,
          ImmutableSparseMatrix,
      )
  
      c = CrashingCodePrinter()
  
      # these should not silently succeed
      with raises(PrintMethodNotImplementedError):
          c.doprint(ImmutableSparseMatrix(2, 2, {}))
      with raises(PrintMethodNotImplementedError):
          c.doprint(MutableSparseMatrix(2, 2, {}))
  
file_path: sympy/sympy/printing/tests/test_codeprinter.py
imports: from sympy.printing.codeprinter import CodePrinter, PrintMethodNotImplementedError
  from sympy.core import symbols
  from sympy.core.symbol import Dummy
  from sympy.testing.pytest import raises
label_desc: Use image node_id 4 for calling a global function with example usage: test_issue_15791() without return types