code: def test_exception_pos_single_graph(to_latex=nx.to_latex):
      # smoke test that pos can be a string
      G = nx.path_graph(4)
      to_latex(G, pos="pos")
  
      # must include all nodes
      pos = {0: (1, 2), 1: (0, 1), 2: (2, 1)}
      with pytest.raises(nx.NetworkXError):
          to_latex(G, pos)
  
      # must have 2 values
      pos[3] = (1, 2, 3)
      with pytest.raises(nx.NetworkXError):
          to_latex(G, pos)
      pos[3] = 2
      with pytest.raises(nx.NetworkXError):
          to_latex(G, pos)
  
      # check that passes with 2 values
      pos[3] = (3, 2)
      to_latex(G, pos)
  
file_path: networkx/networkx/drawing/tests/test_latex.py
imports: import pytest
  import networkx
label_desc: Use image node_id 4 for calling a global function with example usage: test_exception_pos_single_graph(to_latex) without return types