class_docstr: Unit tests for the local reaching centrality function.
class_docstr_tok: ["Unit","tests","for","the","local","reaching","centrality","function","."]
code: def test_negatively_weighted(self):
      with pytest.raises(nx.NetworkXError):
          G = nx.Graph()
          G.add_weighted_edges_from([(0, 1, -2), (1, 2, +1)])
          nx.local_reaching_centrality(G, 0, weight="weight")
  
file_path: networkx/networkx/algorithms/centrality/tests/test_reaching.py
imports: import pytest
  import networkx
label_desc: Use image node_id 2 for calling the TestLocalReachingCentrality obj's underlying member method code with example usage: obj.test_negatively_weighted() without return types