[noble+] TestResult has no addDuration method with Python 3.12
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nose (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Noble |
New
|
Undecided
|
Unassigned | ||
Oracular |
Won't Fix
|
Undecided
|
Unassigned | ||
Plucky |
New
|
Undecided
|
Unassigned | ||
Questing |
New
|
Undecided
|
Unassigned | ||
python-mock (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Noble |
New
|
Undecided
|
Unassigned | ||
Oracular |
Won't Fix
|
Undecided
|
Unassigned | ||
Plucky |
New
|
Undecided
|
Unassigned | ||
Questing |
New
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Spurious warnings in tests since Python 3.12, might cause tests to fail when asserting that stderr is empty.
[Test plan]
Run the update-manager autopkgtest and see no such warning.
[Where problems could occur]
There is no regression potential basically. The code creating the warning in Python 3.12+ looks like:
def _addDuration(self, result, elapsed):
try:
except AttributeError:
else:
that is, if the addDuration method does not exist, it logs a warning and does nothing else. By adding the addDuration method, the warning is not printed.
The addDuration method adds the execution time of the test to the test result, but nose's test results does not track that, so meh.
description: | updated |
summary: |
- [oracular+] TestResult has no addDuration method + [noble+] TestResult has no addDuration method with Python 3.12 |
Hacking up my Python to raise an exception instead I get
'ResultProxy' object has no attribute 'addDuration'
i.e. mock's ResultProxy class is also affected.
For nose, the nose2 commit https:/ /github. com/nose- devs/nose2/ pull/570/ files applies to nose too.
I may not pursue this further as this is comparatively lower priority to my other work.