summaryrefslogtreecommitdiff
path: root/networkx/algorithms/centrality/tests/test_current_flow_closeness.py
diff options
context:
space:
mode:
Diffstat (limited to 'networkx/algorithms/centrality/tests/test_current_flow_closeness.py')
-rw-r--r--networkx/algorithms/centrality/tests/test_current_flow_closeness.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/networkx/algorithms/centrality/tests/test_current_flow_closeness.py b/networkx/algorithms/centrality/tests/test_current_flow_closeness.py
index c2fa4ec0..24a916a4 100644
--- a/networkx/algorithms/centrality/tests/test_current_flow_closeness.py
+++ b/networkx/algorithms/centrality/tests/test_current_flow_closeness.py
@@ -4,7 +4,6 @@ pytest.importorskip("numpy")
pytest.importorskip("scipy")
import networkx as nx
-from networkx.testing import almost_equal
class TestFlowClosenessCentrality:
@@ -14,7 +13,7 @@ class TestFlowClosenessCentrality:
b = nx.current_flow_closeness_centrality(G)
b_answer = {0: 2.0 / 3, 1: 2.0 / 3, 2: 2.0 / 3, 3: 2.0 / 3}
for n in sorted(G):
- assert almost_equal(b[n], b_answer[n])
+ assert b[n] == pytest.approx(b_answer[n], abs=1e-7)
def test_P4(self):
"""Closeness centrality: P4"""
@@ -22,7 +21,7 @@ class TestFlowClosenessCentrality:
b = nx.current_flow_closeness_centrality(G)
b_answer = {0: 1.0 / 6, 1: 1.0 / 4, 2: 1.0 / 4, 3: 1.0 / 6}
for n in sorted(G):
- assert almost_equal(b[n], b_answer[n])
+ assert b[n] == pytest.approx(b_answer[n], abs=1e-7)
def test_star(self):
"""Closeness centrality: star"""
@@ -31,7 +30,7 @@ class TestFlowClosenessCentrality:
b = nx.current_flow_closeness_centrality(G)
b_answer = {"a": 1.0 / 3, "b": 0.6 / 3, "c": 0.6 / 3, "d": 0.6 / 3}
for n in sorted(G):
- assert almost_equal(b[n], b_answer[n])
+ assert b[n] == pytest.approx(b_answer[n], abs=1e-7)
class TestWeightedFlowClosenessCentrality: