code: def test_tricontour_non_finite_z():
      # github issue 10167.
      x = [0, 1, 0, 1]
      y = [0, 0, 1, 1]
      triang = mtri.Triangulation(x, y)
      plt.figure()
  
      with pytest.raises(
          ValueError,
          match="z array must not contain non-finite "
          "values within the triangulation",
      ):
          plt.tricontourf(triang, [0, 1, 2, np.inf])
  
      with pytest.raises(
          ValueError,
          match="z array must not contain non-finite "
          "values within the triangulation",
      ):
          plt.tricontourf(triang, [0, 1, 2, -np.inf])
  
      with pytest.raises(
          ValueError,
          match="z array must not contain non-finite "
          "values within the triangulation",
      ):
          plt.tricontourf(triang, [0, 1, 2, np.nan])
  
      with pytest.raises(
          ValueError,
          match="z must not contain masked points "
          "within the triangulation",
      ):
          plt.tricontourf(
              triang, np.ma.array([0, 1, 2, 3], mask=[1, 0, 0, 0])
          )
  
imports: import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_array_less
  import numpy.ma.testutils
  import pytest
  import matplotlib
  import matplotlib.pyplot
  import matplotlib.tri
  from matplotlib.path import Path
  from matplotlib.testing.decorators import image_comparison, check_figures_equal
label_desc: Use image node_id 34 for calling a global function with example usage: test_tricontour_non_finite_z() without return types