class_docstr: Unit tests for the approximate diameter function
  :func:`~networkx.algorithms.approximation.distance_measures.diameter`.
docstr: Test empty graph.
code: def test_null_graph(self):
      """Test empty graph."""
      G = nx.null_graph()
      with pytest.raises(
          nx.NetworkXError, match="Expected non-empty NetworkX graph!"
      ):
          diameter(G)
  
file_path: networkx/networkx/algorithms/approximation/tests/test_distance_measures.py
imports: import pytest
  import networkx
  from networkx.algorithms.approximation import diameter
label_desc: Use image node_id 1 for calling the TestDiameter obj's underlying member method code with example usage: obj.test_null_graph() without return types