class_docstr: Unit tests for the approximate diameter function
  :func:`~networkx.algorithms.approximation.distance_measures.diameter`.
docstr: Test a directed non strongly connected graph.
code: def test_directed_non_strongly_connected(self):
      """Test a directed non strongly connected graph."""
      graph = nx.path_graph(10, create_using=nx.DiGraph())
      with pytest.raises(
          nx.NetworkXError, match="DiGraph not strongly connected."
      ):
          diameter(graph)
  
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 3 for calling the TestDiameter obj's underlying member method code with example usage: obj.test_directed_non_strongly_connected() without return types