def METHOD_NAME(console_plugin, mocker):
    """Test that error dialog is called."""
    widget = console_plugin.get_widget()
    shell = widget.shell
    # Avoid showing the error dialog.
    mocker.patch('spyder.widgets.reporterror.SpyderErrorDialog.show',
                 return_value=None)
    # --- Test internal errors in Spyder
    # Write error in the console
    error = """Traceback (most recent call last):
  File "/home/foo/miniconda3/envs/py37/lib/python3.7/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<console>", line 2, in <module>