From 83f524556a778576d2899312f3122e10795b79a74650a7d597ee992b6da5b523 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Mon, 20 Feb 2023 08:51:38 +0000 Subject: [PATCH] - Add python-311.patch to support python 3.11 gh#xmlrunner/unittest-xml-reporting#274 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-unittest-xml-reporting?expand=0&rev=30 --- python-311.patch | 23 +++++++++++++++++++++++ python-unittest-xml-reporting.changes | 6 ++++++ python-unittest-xml-reporting.spec | 7 ++++--- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 python-311.patch diff --git a/python-311.patch b/python-311.patch new file mode 100644 index 0000000..f1a85de --- /dev/null +++ b/python-311.patch @@ -0,0 +1,23 @@ +Index: unittest-xml-reporting-3.0.2/xmlrunner/result.py +=================================================================== +--- unittest-xml-reporting-3.0.2.orig/xmlrunner/result.py ++++ unittest-xml-reporting-3.0.2/xmlrunner/result.py +@@ -179,6 +179,9 @@ class _TestInfo(object): + """ + return self.test_exception_info + ++ def shortDescription(self): ++ return self.test_description ++ + + class _XMLTestResult(_TextTestResult): + """ +@@ -658,3 +661,8 @@ class _XMLTestResult(_TextTestResult): + 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) diff --git a/python-unittest-xml-reporting.changes b/python-unittest-xml-reporting.changes index c8ef947..7db0830 100644 --- a/python-unittest-xml-reporting.changes +++ b/python-unittest-xml-reporting.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Feb 20 08:50:03 UTC 2023 - Daniel Garcia + +- Add python-311.patch to support python 3.11 + gh#xmlrunner/unittest-xml-reporting#274 + ------------------------------------------------------------------- Wed Oct 19 12:10:51 UTC 2022 - Daniel Garcia diff --git a/python-unittest-xml-reporting.spec b/python-unittest-xml-reporting.spec index 975f320..587eef8 100644 --- a/python-unittest-xml-reporting.spec +++ b/python-unittest-xml-reporting.spec @@ -1,7 +1,7 @@ # # spec file for package python-unittest-xml-reporting # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-unittest-xml-reporting Version: 3.0.2 @@ -25,6 +24,8 @@ Summary: PyUnit-based test runner with JUnit like XML reporting License: LGPL-3.0-or-later URL: https://github.com/xmlrunner/unittest-xml-reporting Source: https://github.com/xmlrunner/unittest-xml-reporting/archive/%{version}.tar.gz +# PATCH-FIX-UPSTREAM python-311.patch gh#xmlrunner/unittest-xml-reporting#274 +Patch0: python-311.patch BuildRequires: %{python_module lxml} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} @@ -40,7 +41,7 @@ to XML files that can be consumed by a wide range of tools, such as build systems, IDEs and continuous integration servers. %prep -%setup -q -n unittest-xml-reporting-%{version} +%autosetup -p1 -n unittest-xml-reporting-%{version} %build %python_build