Skip to content

Commit 027237b

Browse files
authored
add: ignore warnings on structural unittests (#834)
1 parent 6d2fc69 commit 027237b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/test_structural.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,19 +503,28 @@ def testEigenvectorCentrality(self):
503503

504504
def testAuthorityScore(self):
505505
g = Graph.Tree(15, 2, TREE_IN)
506-
asc = g.authority_score()
506+
507+
with warnings.catch_warnings():
508+
warnings.simplefilter("ignore")
509+
asc = g.authority_score()
507510
self.assertAlmostEqual(max(asc), 1.0, places=3)
508511

509512
# Smoke testing
510-
g.authority_score(scale=False, return_eigenvalue=True)
513+
with warnings.catch_warnings():
514+
warnings.simplefilter("ignore")
515+
g.authority_score(scale=False, return_eigenvalue=True)
511516

512517
def testHubScore(self):
513518
g = Graph.Tree(15, 2, TREE_IN)
514-
hsc = g.hub_score()
519+
with warnings.catch_warnings():
520+
warnings.simplefilter("ignore")
521+
hsc = g.hub_score()
515522
self.assertAlmostEqual(max(hsc), 1.0, places=3)
516523

517524
# Smoke testing
518-
g.hub_score(scale=False, return_eigenvalue=True)
525+
with warnings.catch_warnings():
526+
warnings.simplefilter("ignore")
527+
g.hub_score(scale=False, return_eigenvalue=True)
519528

520529
def testCoreness(self):
521530
g = Graph.Full(4) + Graph(4) + [(0, 4), (1, 5), (2, 6), (3, 7)]

0 commit comments

Comments
 (0)