-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
type::bugdescribes erroneous operation, use severity::* to classify the typedescribes erroneous operation, use severity::* to classify the type
Description
Checklist
- I added a descriptive title
- I searched open reports and couldn't find a duplicate
What happened?
conda-forge/pycosat-feedstock#34 is failing because of a function unittest.makeSuite
that was deprecated in Python 3.11 and removed in Python 3.13.
Line 261 in ba33b47
suite.addTest(unittest.makeSuite(cls)) |
This can be replaced with unittest.defaultTestLoader.loadTestsFromTestCase
.
This is a patch that I verified is working:
diff --git a/test_pycosat.py b/test_pycosat.py
index f1165d8..0a6969c 100644
--- a/test_pycosat.py
+++ b/test_pycosat.py
@@ -258,7 +258,7 @@ def run(verbosity=1, repeat=1):
suite = unittest.TestSuite()
for cls in tests:
for _ in range(repeat):
- suite.addTest(unittest.makeSuite(cls))
+ suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(cls))
runner = unittest.TextTestRunner(verbosity=verbosity)
return runner.run(suite)
unittest.defaultTestLoader.loadTestsFromTestCase
appears to be backwards compatible as far back as Python 2.7, so there's no loss in compatibility from changing.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
type::bugdescribes erroneous operation, use severity::* to classify the typedescribes erroneous operation, use severity::* to classify the type
Type
Projects
Status
🆕 New