Skip to content

Commit 87e9ebc

Browse files
committed
fix: replace deprecated unittest.makeSuite with TestLoader for Python 3.13 compatibility
- Replace unittest.makeSuite() with unittest.TestLoader().loadTestsFromTestCase() - unittest.makeSuite() was deprecated in Python 3.2 and removed in Python 3.13 - Add documentation comments explaining the change - Fixes CI/CD pipeline failure on Python 3.13 Closes compatibility issues with Python 3.13+ while maintaining backward compatibility
1 parent 3a4c16e commit 87e9ebc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test_converter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,12 @@ def run_tests():
303303
# Create a test suite
304304
suite = unittest.TestSuite()
305305

306-
# Add all test cases
307-
suite.addTest(unittest.makeSuite(TestMarkdownToBBCodeConverter))
308-
suite.addTest(unittest.makeSuite(TestCLIIntegration))
306+
# Add all test cases using the modern approach
307+
# Note: unittest.makeSuite() was deprecated and removed in Python 3.13
308+
# Using TestLoader().loadTestsFromTestCase() instead for compatibility
309+
loader = unittest.TestLoader()
310+
suite.addTest(loader.loadTestsFromTestCase(TestMarkdownToBBCodeConverter))
311+
suite.addTest(loader.loadTestsFromTestCase(TestCLIIntegration))
309312

310313
# Run the tests
311314
runner = unittest.TextTestRunner(verbosity=2)

0 commit comments

Comments
 (0)