- Fix tests on Python 3.12 with tests-int-division.patch OBS-URL: https://build.opensuse.org/request/show/1158180 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-python-louvain?expand=0&rev=20
14 lines
658 B
Diff
14 lines
658 B
Diff
Index: python-louvain-0.16/test_community.py
|
|
===================================================================
|
|
--- python-louvain-0.16.orig/test_community.py
|
|
+++ python-louvain-0.16/test_community.py
|
|
@@ -61,7 +61,7 @@ class ModularityTest(unittest.TestCase):
|
|
graph = nx.erdos_renyi_graph(50, 0.1)
|
|
part = dict([])
|
|
for node in graph:
|
|
- part[node] = random.randint(0, self.number_of_tests / 10)
|
|
+ part[node] = random.randint(0, self.number_of_tests // 10)
|
|
mod = co.modularity(part, graph)
|
|
self.assertGreaterEqual(mod, -1)
|
|
self.assertLessEqual(mod, 1)
|