docstr: Tests that exception is raised when either
  source or target is not in graph
docstr_tok: ["Tests","that","exception","is","raised","when","either","source","or","target","is","not","in","graph"]
code: def test_astar_NodeNotFound(self):
      """Tests that exception is raised when either
      source or target is not in graph"""
      G = nx.gnp_random_graph(10, 0.2, seed=10)
      with pytest.raises(nx.NodeNotFound):
          nx.astar_path_length(G, 11, 9)
  
imports: import pytest
  import networkx
  from networkx.utils import pairwise
label_desc: Use image node_id 21 for calling the TestAStar obj's underlying member method code with example usage: obj.test_astar_NodeNotFound() without return types