class_docstr: Unit tests for the :func:`~networkx.stochastic_graph` function.
docstr: Smoke test: ensure ZeroDivisionError is not raised.
docstr_tok: ["Smoke","test",":","ensure","ZeroDivisionError","is","not","raised","."]
code: def test_zero_weights(self):
      """Smoke test: ensure ZeroDivisionError is not raised."""
      G = nx.DiGraph()
      G.add_edge(0, 1, weight=0)
      G.add_edge(0, 2, weight=0)
      S = nx.stochastic_graph(G)
      assert sorted(S.edges(data=True)) == [
          (0, 1, {"weight": 0}),
          (0, 2, {"weight": 0}),
      ]
  
file_path: networkx/networkx/generators/tests/test_stochastic.py
imports: import pytest
  import networkx
label_desc: Use image node_id 5 for calling the TestStochasticGraph obj's underlying member method code with example usage: obj.test_zero_weights() without return types