code: def test_init_sanity():
      """
      Tests to ensure the constructor behaves as expected.
      """
      parent = QtWidgets.QMainWindow()
      figsize = (1.0, 4.0)
      dpi = 256
  
      # These tests will not work if these two assertions do not hold.
      assert figsize != default_figsize
      assert dpi != default_dpi
  
      mplw = MatplotlibWidget(parent, figsize=figsize)
      assert_widget_fields(mplw, parent, figsize, default_dpi)
  
      mplw = MatplotlibWidget(parent, dpi=dpi)
      assert_widget_fields(mplw, parent, default_figsize, dpi)
  
      mplw = MatplotlibWidget(parent, figsize, dpi)
      assert_widget_fields(mplw, parent, figsize, dpi)
  
      mplw = MatplotlibWidget(figsize, dpi)
      assert_widget_fields(mplw, default_parent, figsize, dpi)
  
      mplw = MatplotlibWidget(figsize, dpi, parent)
      assert_widget_fields(mplw, parent, figsize, dpi)
  
      mplw = MatplotlibWidget(dpi=dpi, parent=parent)
      assert_widget_fields(mplw, parent, default_figsize, dpi)
  
file_path: pyqtgraph/tests/widgets/test_matplotlibwidget.py
imports: from importlib.metadata import version
  import numpy
  import pytest
  import pyqtgraph
  from pyqtgraph.Qt import QtWidgets
  from pyqtgraph.widgets.MatplotlibWidget import MatplotlibWidget
label_desc: Use image node_id 5 for calling a global function with example usage: test_init_sanity() without return types