code: def test_discouraged_api():
      fig, ax = plt.subplots(constrained_layout=True)
      fig.draw_without_rendering()
  
      with pytest.warns(
          PendingDeprecationWarning, match="will be deprecated"
      ):
          fig, ax = plt.subplots()
          fig.set_constrained_layout(True)
          fig.draw_without_rendering()
  
      with pytest.warns(
          PendingDeprecationWarning, match="will be deprecated"
      ):
          fig, ax = plt.subplots()
          fig.set_constrained_layout({"w_pad": 0.02, "h_pad": 0.02})
          fig.draw_without_rendering()
  
imports: import gc
  import numpy
  import pytest
  import matplotlib
  from matplotlib.testing.decorators import image_comparison
  import matplotlib.pyplot
  import matplotlib.transforms
  from matplotlib import gridspec, ticker
label_desc: Use image node_id 39 for calling a global function with example usage: test_discouraged_api() without return types