You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHub tests are failing on Python 3.12 alpha 7 #569
(__main__.Test.test) ... /opt/hostedtoolcache/Python/3.12.0-alpha.7/x64/lib/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method\n warnings.warn("TestResult has no addDuration method",\nok\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nOK\n'
Without getting into deep analysys: the test seems to fail because unittest.TestCase class in python 3.12 has a new addDuration method. I imagine nose subclasses unittest.TestCase and extends it in some way. Python 3.12's unittest module is complaining (warning) that your custom sublcass does not provide an addDuration method. Defining an addDuration method will remove the warning and fix the failure.
.. method:: addDuration(test, elapsed)
Called when the test case finishes. *elapsed* is the time represented in
seconds, and it includes the execution of cleanup functions.
.. versionadded:: 3.12
My thanks to both of you for running this down and providing the breadcrumbs for me to understand what was happening. I've just merged @cclauss's fix and will make sure to cite him in the changelog under py3.12 compatibility.
Activity
giampaolo commentedon Apr 20, 2023
Seems related to: python/cpython#12271.
Without getting into deep analysys: the test seems to fail because
unittest.TestCaseclass in python 3.12 has a newaddDurationmethod. I imagine nose subclassesunittest.TestCaseand extends it in some way. Python 3.12's unittest module is complaining (warning) that your custom sublcass does not provide anaddDurationmethod. Defining anaddDurationmethod will remove the warning and fix the failure.cclauss commentedon Apr 20, 2023
https://github.com/python/cpython/pull/12271/files#diff-14c3c1d897d1e85767303f24626acaa6d1ea1162219c72caa240ef9f533ebe99R2176-R2181
sirosen commentedon Apr 25, 2023
My thanks to both of you for running this down and providing the breadcrumbs for me to understand what was happening. I've just merged @cclauss's fix and will make sure to cite him in the changelog under py3.12 compatibility.
Fixed ImportError for '_TextTestResult' on Python 3.12; fixed 'addDur…