class_docstr: Nose Unit tests for the :mod:`networkx.algorithms.planarity` module.
  
  Tests three things:
  1. Check that the result is correct
      (returns planar if and only if the graph is actually planar)
  2. In case a counter example is returned: Check if it is correct
  3. In case an embedding is returned: Check if its actually an embedding
class_docstr_tok: ["Nose","Unit","tests","for","the",":","mod",":","`","networkx.algorithms.planarity","`","module",".","Tests","three","things",":","1",".","Check","that","the","result","is","correct","(","returns","planar","if","and","only","if","the","graph","is","actually","planar",")","2",".","In","case","a","counter","example","is","returned",":","Check","if","it","is","correct","3",".","In","case","an","embedding","is","returned",":","Check","if","its","actually","an","embedding"]
docstr: Raises an exception if the lr_planarity check returns a wrong result
  
  Parameters
  ----------
  G : NetworkX graph
  is_planar : bool
      The expected result of the planarity check.
      If set to None only counter example or embedding are verified.
code: def check_graph(G, is_planar=None):
      """Raises an exception if the lr_planarity check returns a wrong result
  
      Parameters
      ----------
      G : NetworkX graph
      is_planar : bool
          The expected result of the planarity check.
          If set to None only counter example or embedding are verified.
  
      """
  
      # obtain results of planarity check
      is_planar_lr, result = nx.check_planarity(G, True)
      is_planar_lr_rec, result_rec = check_planarity_recursive(G, True)
  
      if is_planar is not None:
          # set a message for the assert
          if is_planar:
              msg = "Wrong planarity check result. Should be planar."
          else:
              msg = (
                  "Wrong planarity check result. Should be non-planar."
              )
  
          # check if the result is as expected
          assert is_planar == is_planar_lr, msg
          assert is_planar == is_planar_lr_rec, msg
  
      if is_planar_lr:
          # check embedding
          check_embedding(G, result)
          check_embedding(G, result_rec)
      else:
          # check counter example
          check_counterexample(G, result)
          check_counterexample(G, result_rec)
  
imports: import pytest
  import networkx
  from networkx.algorithms.planarity import check_planarity_recursive, get_counterexample, get_counterexample_recursive
label_desc: Use image node_id 1 for calling the TestLRPlanarity obj's underlying member method code with example usage: obj.check_graph(G, is_planar) without return types