From: Michael R. Crusoe <crusoe@debian.org>
Subject: Add Pytest 8 compat
Forwarded: https://github.com/dib-lab/khmer/pull/1923

https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose

--- khmer.orig/tests/test_assembly.py
+++ khmer/tests/test_assembly.py
@@ -54,7 +54,7 @@
 from .graph_features import K
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
--- khmer.orig/tests/test_countgraph.py
+++ khmer/tests/test_countgraph.py
@@ -62,7 +62,7 @@
 DNA = "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
@@ -116,7 +116,7 @@
 
 class Test_Countgraph(object):
 
-    def setup(self):
+    def setup_method(self):
         self.hi = khmer.Countgraph(12, 1, 1, primes=PRIMES_1m)
 
     def test_failed_get(self):
--- khmer.orig/tests/test_counting_single.py
+++ khmer/tests/test_counting_single.py
@@ -329,7 +329,7 @@
 
 class Test_ConsumeString(object):
 
-    def setup(self):
+    def setup_method(self):
         self.kh = khmer.Countgraph(4, 1, 1, primes=[4 ** 4])
 
     def test_n_occupied(self):
@@ -374,7 +374,7 @@
 
 class Test_AbundanceDistribution(object):
 
-    def setup(self):
+    def setup_method(self):
         self.kh = khmer.Countgraph(4, 100, 1)
         A_filename = utils.get_test_data('all-A.fa')
         self.kh.consume_seqfile(A_filename)
--- khmer.orig/tests/test_cython_parsing.py
+++ khmer/tests/test_cython_parsing.py
@@ -16,7 +16,7 @@
 import screed
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
--- khmer.orig/tests/test_graph.py
+++ khmer/tests/test_graph.py
@@ -41,13 +41,13 @@
 from . import khmer_tst_utils as utils
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
 class Test_ExactGraphFu(object):
 
-    def setup(self):
+    def setup_method(self):
         self.ht = khmer.Nodegraph(12, 1e4, 2)
 
     def test_counts(self):
@@ -141,7 +141,7 @@
 
 class Test_InexactGraphFu(object):
 
-    def setup(self):
+    def setup_method(self):
         self.ht = khmer.Nodegraph(12, 4 ** 3 + 1, 2)
 
     def test_graph_links_next_a(self):
--- khmer.orig/tests/test_hll.py
+++ khmer/tests/test_hll.py
@@ -50,7 +50,7 @@
 TRANSLATE = {'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C'}
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
--- khmer.orig/tests/test_labelhash.py
+++ khmer/tests/test_labelhash.py
@@ -44,7 +44,7 @@
 from . import khmer_tst_utils as utils
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 #
--- khmer.orig/tests/test_nodegraph.py
+++ khmer/tests/test_nodegraph.py
@@ -48,7 +48,7 @@
 from . import khmer_tst_utils as utils
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
--- khmer.orig/tests/test_sandbox_scripts.py
+++ khmer/tests/test_sandbox_scripts.py
@@ -55,7 +55,7 @@
     return script
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
--- khmer.orig/tests/test_scripts.py
+++ khmer/tests/test_scripts.py
@@ -51,7 +51,7 @@
 import screed
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
--- khmer.orig/tests/test_subset_graph.py
+++ khmer/tests/test_subset_graph.py
@@ -43,7 +43,7 @@
 from . import khmer_tst_utils as utils
 
 
-def teardown():
+def teardown_module():
     utils.cleanup()
 
 
