Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ The files can be consumed by a wide range of tools, such as build systems, IDEs
toolchain = {'name': 'GCCcore', 'version': '12.3.0'}

sources = [SOURCE_TAR_GZ]
checksums = ['c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317']
patches = ['unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch']
checksums = [
{'unittest-xml-reporting-3.1.0.tar.gz': 'c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317'},
{'unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch':
'0be7cd72e25ffab26df2997ddc95124f99eb789715172f3433a4608bedd0a441'}
]

builddependencies = [('binutils', '2.40')]
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ The files can be consumed by a wide range of tools, such as build systems, IDEs
toolchain = {'name': 'GCCcore', 'version': '13.2.0'}

sources = [SOURCE_TAR_GZ]
checksums = ['c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317']
patches = ['unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch']
checksums = [
{'unittest-xml-reporting-3.1.0.tar.gz': 'c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317'},
{'unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch':
'0be7cd72e25ffab26df2997ddc95124f99eb789715172f3433a4608bedd0a441'}
]

builddependencies = [('binutils', '2.40')]
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ The files can be consumed by a wide range of tools, such as build systems, IDEs
toolchain = {'name': 'GCCcore', 'version': '13.3.0'}

sources = [SOURCE_TAR_GZ]
checksums = ['c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317']
patches = ['unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch']
checksums = [
{'unittest-xml-reporting-3.1.0.tar.gz': 'c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317'},
{'unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch':
'0be7cd72e25ffab26df2997ddc95124f99eb789715172f3433a4608bedd0a441'}
]

builddependencies = [('binutils', '2.42')]
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ The files can be consumed by a wide range of tools, such as build systems, IDEs
toolchain = {'name': 'GCCcore', 'version': '14.2.0'}

sources = [SOURCE_TAR_GZ]
checksums = ['c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317']
patches = ['unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch']
checksums = [
{'unittest-xml-reporting-3.1.0.tar.gz': 'c6178ad2d782c5c21d129758f089fd26da2cba8428cf2905994aa105a13fb317'},
{'unittest-xml-reporting-3.1.0_fix-getDescription-python-3.11.patch':
'0be7cd72e25ffab26df2997ddc95124f99eb789715172f3433a4608bedd0a441'}
]

builddependencies = [('binutils', '2.42')]
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From https://github.com/xmlrunner/unittest-xml-reporting/pull/274

From: =?UTF-8?q?Arttu=20Per=C3=A4l=C3=A4?= <[email protected]>
Date: Tue, 3 Jan 2023 14:36:48 +0200
Subject: [PATCH] Fix test result description fetching on Python 3.11

Python 3.11 changes `TextTestResult.printErrors()` to print out
unexpected successes and their descriptions.

Fixes:
> File "/lib/python3.12/unittest/runner.py", line 152, in printErrors
> self.stream.writeln(f"UNEXPECTED SUCCESS: {self.getDescription(test)}")
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/lib/python3.12/unittest/runner.py", line 50, in getDescription
> doc_first_line = test.shortDescription()
> ^^^^^^^^^^^^^^^^^^^^^
> AttributeError: 'tuple' object has no attribute 'shortDescription'

diff --git a/xmlrunner/result.py b/xmlrunner/result.py
index 96fc675..03f2150 100644
--- a/xmlrunner/result.py
+++ b/xmlrunner/result.py
@@ -188,6 +188,9 @@ def get_error_info(self):
"""
return self.test_exception_info

+ def shortDescription(self):
+ return self.test_description
+

class _XMLTestResult(TextTestResult):
"""
@@ -673,3 +676,8 @@ def generate_reports(self, test_runner):
def _exc_info_to_string(self, err, test):
"""Converts a sys.exc_info()-style tuple of values into a string."""
return super(_XMLTestResult, self)._exc_info_to_string(err, test)
+
+ def getDescription(self, test):
+ if isinstance(test, tuple):
+ test = test[0]
+ return super().getDescription(test)