class_docstr: Unit tests for the local_bridge function.
code: def test_weight(self):
      inf = float("inf")
      G = self.square.copy()
  
      G.edges[1, 2]["weight"] = 2
      expected = {
          (u, v, 5 - wt)
          for u, v, wt in G.edges(data="weight", default=1)
      }
      assert set(nx.local_bridges(G, weight="weight")) == expected
  
      expected = {(u, v, 6) for u, v in G.edges}
      lb = nx.local_bridges(G, weight=lambda u, v, d: 2)
      assert set(lb) == expected
  
file_path: networkx/networkx/algorithms/tests/test_bridges.py
imports: import pytest
  import networkx
label_desc: Use image node_id 4 for calling the TestLocalBridges obj's underlying member method code with example usage: obj.test_weight() without return types