code: def test_legend():
      fig, ax = plt.subplots()
      ax.plot([1, 2, 3], label="label")
      ax.legend().set_visible(False)
      _assert_output_equal(
          fake_renderer_output(fig, FakeRenderer),
          """
                           opening figure
                           opening axes
                           draw path with 3 vertices
                           opening legend
                           closing legend
                           closing axes
                           closing figure
                           """,
      )
  
imports: import matplotlib
  import numpy
  import pytest
  from numpy.testing import assert_warns
  from packaging.version import Version
  from ..exporter import Exporter
  from ..renderers import FakeRenderer, FullFakeRenderer
  from .None import plt
label_desc: Use image node_id 11 for calling a global function with example usage: test_legend() without return types