Skip to content

Python 3.13 removed some deprecated unittest features

In https://bugs.python.org/issue5846 (Python 3.11), the makeSuite() function in the unittest module was deprecated.

In Python 3.13, the makeSuite() function has been removed completely.

This function is used in vtkmodules.test.Testing and its absence causes many test failures:

vtk version 9.3.20240913
Traceback (most recent call last):
  File "lib/python3.13/site-packages/vtkmodules/test/rtImageTest.py", line 81, in main
    exec(compile(test_code, test_script, 'exec'), test_script_vars)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Rendering/PythonContext2D/Testing/Python/testPythonItem.py", line 176, in <module>
    Testing.main([(TestPythonItem, 'test')])
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "lib/python3.13/site-packages/vtkmodules/test/Testing.py", line 485, in main
    result = test(cases)
  File "lib/python3.13/site-packages/vtkmodules/test/Testing.py", line 519, in test
    suites.append(unittest.makeSuite(case[0], case[1]))
                  ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/unittest/__init__.py", line 80, in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
AttributeError: module 'unittest' has no attribute 'makeSuite'