From d612b10df8f01b0746de4b8423e55e809b509c21 Mon Sep 17 00:00:00 2001 From: BeaMarton13 Date: Tue, 17 Jun 2025 14:41:20 +0300 Subject: [PATCH] add: ignore warnings on structural unittests --- tests/test_structural.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_structural.py b/tests/test_structural.py index 3d310dc53..c0f1bdb59 100644 --- a/tests/test_structural.py +++ b/tests/test_structural.py @@ -503,19 +503,28 @@ def testEigenvectorCentrality(self): def testAuthorityScore(self): g = Graph.Tree(15, 2, TREE_IN) - asc = g.authority_score() + + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + asc = g.authority_score() self.assertAlmostEqual(max(asc), 1.0, places=3) # Smoke testing - g.authority_score(scale=False, return_eigenvalue=True) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + g.authority_score(scale=False, return_eigenvalue=True) def testHubScore(self): g = Graph.Tree(15, 2, TREE_IN) - hsc = g.hub_score() + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + hsc = g.hub_score() self.assertAlmostEqual(max(hsc), 1.0, places=3) # Smoke testing - g.hub_score(scale=False, return_eigenvalue=True) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + g.hub_score(scale=False, return_eigenvalue=True) def testCoreness(self): g = Graph.Full(4) + Graph(4) + [(0, 4), (1, 5), (2, 6), (3, 7)]