summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2022-11-01 10:59:00 -0700
committerJarrod Millman <jarrod.millman@gmail.com>2022-11-01 11:53:55 -0700
commit5da3df4bd397dc1f567eea5c26c42936285d98b8 (patch)
treeb2023671cbb702f78e77f1eeb0710d67e657b4cf
parent8d69d625fdf97347a2eefe4cc4ec913c8756efb8 (diff)
downloadnetworkx-5da3df4bd397dc1f567eea5c26c42936285d98b8.tar.gz
Update pytest
-rw-r--r--networkx/algorithms/bipartite/tests/test_matching.py2
-rw-r--r--networkx/algorithms/community/tests/test_kclique.py2
-rw-r--r--networkx/algorithms/flow/tests/test_maxflow.py2
-rw-r--r--networkx/algorithms/isomorphism/tests/test_match_helpers.py2
-rw-r--r--networkx/algorithms/shortest_paths/tests/test_weighted.py2
-rw-r--r--networkx/algorithms/tests/test_structuralholes.py2
-rw-r--r--networkx/algorithms/tree/tests/test_mst.py2
-rw-r--r--networkx/classes/tests/test_coreviews.py16
-rw-r--r--networkx/classes/tests/test_graphviews.py8
-rw-r--r--networkx/utils/tests/test_mapped_queue.py2
-rw-r--r--requirements/test.txt4
11 files changed, 22 insertions, 22 deletions
diff --git a/networkx/algorithms/bipartite/tests/test_matching.py b/networkx/algorithms/bipartite/tests/test_matching.py
index 116da84c..abef330e 100644
--- a/networkx/algorithms/bipartite/tests/test_matching.py
+++ b/networkx/algorithms/bipartite/tests/test_matching.py
@@ -16,7 +16,7 @@ from networkx.algorithms.bipartite.matching import (
class TestMatching:
"""Tests for bipartite matching algorithms."""
- def setup(self):
+ def setup_method(self):
"""Creates a bipartite graph for use in testing matching algorithms.
The bipartite graph has a maximum cardinality matching that leaves
diff --git a/networkx/algorithms/community/tests/test_kclique.py b/networkx/algorithms/community/tests/test_kclique.py
index ffac175d..12c8e603 100644
--- a/networkx/algorithms/community/tests/test_kclique.py
+++ b/networkx/algorithms/community/tests/test_kclique.py
@@ -25,7 +25,7 @@ def test_isolated_K5():
class TestZacharyKarateClub:
- def setup(self):
+ def setup_method(self):
self.G = nx.karate_club_graph()
def _check_communities(self, k, expected):
diff --git a/networkx/algorithms/flow/tests/test_maxflow.py b/networkx/algorithms/flow/tests/test_maxflow.py
index b8e985c3..6448a768 100644
--- a/networkx/algorithms/flow/tests/test_maxflow.py
+++ b/networkx/algorithms/flow/tests/test_maxflow.py
@@ -386,7 +386,7 @@ class TestMaxflowMinCutCommon:
class TestMaxFlowMinCutInterface:
- def setup(self):
+ def setup_method(self):
G = nx.DiGraph()
G.add_edge("x", "a", capacity=3.0)
G.add_edge("x", "b", capacity=1.0)
diff --git a/networkx/algorithms/isomorphism/tests/test_match_helpers.py b/networkx/algorithms/isomorphism/tests/test_match_helpers.py
index 8ecc2429..9d7c2944 100644
--- a/networkx/algorithms/isomorphism/tests/test_match_helpers.py
+++ b/networkx/algorithms/isomorphism/tests/test_match_helpers.py
@@ -11,7 +11,7 @@ def test_categorical_node_match():
class TestGenericMultiEdgeMatch:
- def setup(self):
+ def setup_method(self):
self.G1 = nx.MultiDiGraph()
self.G2 = nx.MultiDiGraph()
self.G3 = nx.MultiDiGraph()
diff --git a/networkx/algorithms/shortest_paths/tests/test_weighted.py b/networkx/algorithms/shortest_paths/tests/test_weighted.py
index 2b186968..7d5dae42 100644
--- a/networkx/algorithms/shortest_paths/tests/test_weighted.py
+++ b/networkx/algorithms/shortest_paths/tests/test_weighted.py
@@ -36,7 +36,7 @@ class WeightedTestBase:
"""
- def setup(self):
+ def setup_method(self):
"""Creates some graphs for use in the unit tests."""
cnlti = nx.convert_node_labels_to_integers
self.grid = cnlti(nx.grid_2d_graph(4, 4), first_label=1, ordering="sorted")
diff --git a/networkx/algorithms/tests/test_structuralholes.py b/networkx/algorithms/tests/test_structuralholes.py
index 53a4e88a..51447fee 100644
--- a/networkx/algorithms/tests/test_structuralholes.py
+++ b/networkx/algorithms/tests/test_structuralholes.py
@@ -18,7 +18,7 @@ class TestStructuralHoles:
"""
- def setup(self):
+ def setup_method(self):
self.D = nx.DiGraph()
self.D.add_edges_from([(0, 1), (0, 2), (1, 0), (2, 1)])
self.D_weights = {(0, 1): 2, (0, 2): 2, (1, 0): 1, (2, 1): 1}
diff --git a/networkx/algorithms/tree/tests/test_mst.py b/networkx/algorithms/tree/tests/test_mst.py
index 7daf0fcf..5ed41619 100644
--- a/networkx/algorithms/tree/tests/test_mst.py
+++ b/networkx/algorithms/tree/tests/test_mst.py
@@ -283,7 +283,7 @@ class TestSpanningTreeIterator:
Order of Increasing Cost
"""
- def setup(self):
+ def setup_method(self):
# Original Graph
edges = [(0, 1, 5), (1, 2, 4), (1, 4, 6), (2, 3, 5), (2, 4, 7), (3, 4, 3)]
self.G = nx.Graph()
diff --git a/networkx/classes/tests/test_coreviews.py b/networkx/classes/tests/test_coreviews.py
index 12572b4f..fdea00f9 100644
--- a/networkx/classes/tests/test_coreviews.py
+++ b/networkx/classes/tests/test_coreviews.py
@@ -7,7 +7,7 @@ import networkx as nx
class TestAtlasView:
# node->data
- def setup(self):
+ def setup_method(self):
self.d = {0: {"color": "blue", "weight": 1.2}, 1: {}, 2: {"color": 1}}
self.av = nx.classes.coreviews.AtlasView(self.d)
@@ -62,7 +62,7 @@ class TestAtlasView:
class TestAdjacencyView:
# node->nbr->data
- def setup(self):
+ def setup_method(self):
dd = {"color": "blue", "weight": 1.2}
self.nd = {0: dd, 1: {}, 2: {"color": 1}}
self.adj = {3: self.nd, 0: {3: dd}, 1: {}, 2: {3: {"color": 1}}}
@@ -114,7 +114,7 @@ class TestAdjacencyView:
class TestMultiAdjacencyView(TestAdjacencyView):
# node->nbr->key->data
- def setup(self):
+ def setup_method(self):
dd = {"color": "blue", "weight": 1.2}
self.kd = {0: dd, 1: {}, 2: {"color": 1}}
self.nd = {3: self.kd, 0: {3: dd}, 1: {0: {}}, 2: {3: {"color": 1}}}
@@ -143,7 +143,7 @@ class TestMultiAdjacencyView(TestAdjacencyView):
class TestUnionAtlas:
# node->data
- def setup(self):
+ def setup_method(self):
self.s = {0: {"color": "blue", "weight": 1.2}, 1: {}, 2: {"color": 1}}
self.p = {3: {"color": "blue", "weight": 1.2}, 4: {}, 2: {"watch": 2}}
self.av = nx.classes.coreviews.UnionAtlas(self.s, self.p)
@@ -199,7 +199,7 @@ class TestUnionAtlas:
class TestUnionAdjacency:
# node->nbr->data
- def setup(self):
+ def setup_method(self):
dd = {"color": "blue", "weight": 1.2}
self.nd = {0: dd, 1: {}, 2: {"color": 1}}
self.s = {3: self.nd, 0: {}, 1: {}, 2: {3: {"color": 1}}}
@@ -249,7 +249,7 @@ class TestUnionAdjacency:
class TestUnionMultiInner(TestUnionAdjacency):
# nbr->key->data
- def setup(self):
+ def setup_method(self):
dd = {"color": "blue", "weight": 1.2}
self.kd = {7: {}, "ekey": {}, 9: {"color": 1}}
self.s = {3: self.kd, 0: {7: dd}, 1: {}, 2: {"key": {"color": 1}}}
@@ -284,7 +284,7 @@ class TestUnionMultiInner(TestUnionAdjacency):
class TestUnionMultiAdjacency(TestUnionAdjacency):
# node->nbr->key->data
- def setup(self):
+ def setup_method(self):
dd = {"color": "blue", "weight": 1.2}
self.kd = {7: {}, 8: {}, 9: {"color": 1}}
self.nd = {3: self.kd, 0: {9: dd}, 1: {8: {}}, 2: {9: {"color": 1}}}
@@ -314,7 +314,7 @@ class TestUnionMultiAdjacency(TestUnionAdjacency):
class TestFilteredGraphs:
- def setup(self):
+ def setup_method(self):
self.Graphs = [nx.Graph, nx.DiGraph, nx.MultiGraph, nx.MultiDiGraph]
def test_hide_show_nodes(self):
diff --git a/networkx/classes/tests/test_graphviews.py b/networkx/classes/tests/test_graphviews.py
index 96a09784..d17a424c 100644
--- a/networkx/classes/tests/test_graphviews.py
+++ b/networkx/classes/tests/test_graphviews.py
@@ -7,7 +7,7 @@ from networkx.utils import edges_equal, nodes_equal
class TestReverseView:
- def setup(self):
+ def setup_method(self):
self.G = nx.path_graph(9, create_using=nx.DiGraph())
self.rv = nx.reverse_view(self.G)
@@ -55,7 +55,7 @@ class TestReverseView:
class TestMultiReverseView:
- def setup(self):
+ def setup_method(self):
self.G = nx.path_graph(9, create_using=nx.MultiDiGraph())
self.G.add_edge(4, 5)
self.rv = nx.reverse_view(self.G)
@@ -98,7 +98,7 @@ def test_generic_multitype():
class TestToDirected:
- def setup(self):
+ def setup_method(self):
self.G = nx.path_graph(9)
self.dv = nx.to_directed(self.G)
self.MG = nx.path_graph(9, create_using=nx.MultiGraph())
@@ -137,7 +137,7 @@ class TestToDirected:
class TestToUndirected:
- def setup(self):
+ def setup_method(self):
self.DG = nx.path_graph(9, create_using=nx.DiGraph())
self.uv = nx.to_undirected(self.DG)
self.MDG = nx.path_graph(9, create_using=nx.MultiDiGraph())
diff --git a/networkx/utils/tests/test_mapped_queue.py b/networkx/utils/tests/test_mapped_queue.py
index d4df6346..3570ad27 100644
--- a/networkx/utils/tests/test_mapped_queue.py
+++ b/networkx/utils/tests/test_mapped_queue.py
@@ -40,7 +40,7 @@ def test_HeapElement_getitem():
class TestMappedQueue:
- def setup(self):
+ def setup_method(self):
pass
def _check_map(self, q):
diff --git a/requirements/test.txt b/requirements/test.txt
index 8175aecc8..d5962a87 100644
--- a/requirements/test.txt
+++ b/requirements/test.txt
@@ -1,3 +1,3 @@
-pytest>=7.1
-pytest-cov>=3.0
+pytest>=7.2
+pytest-cov>=4.0
codecov>=2.1