From a56582a9f7cdfe6505a00502610b8fd7a117d140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 12 Apr 2023 16:47:41 +0200 Subject: [PATCH] Backport upstream commit to fix RuntimeWarning: TestResult has no addDuration method --- ...estresult-with-no-addduration-103309.patch | 24 +++++++++++++++++++ python3.12.spec | 9 ++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 00398-gh-48330-assert-warning-is-emitted-on-unittest-testresult-with-no-addduration-103309.patch diff --git a/00398-gh-48330-assert-warning-is-emitted-on-unittest-testresult-with-no-addduration-103309.patch b/00398-gh-48330-assert-warning-is-emitted-on-unittest-testresult-with-no-addduration-103309.patch new file mode 100644 index 0000000..40e9add --- /dev/null +++ b/00398-gh-48330-assert-warning-is-emitted-on-unittest-testresult-with-no-addduration-103309.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> +Date: Thu, 6 Apr 2023 14:05:23 +0100 +Subject: [PATCH] 00398: gh-48330: assert warning is emitted on + unittest.TestResult with no addDuration (#103309) + +--- + Lib/test/test_unittest/test_case.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Lib/test/test_unittest/test_case.py b/Lib/test/test_unittest/test_case.py +index 05d60a8ad3..dd5ff6d553 100644 +--- a/Lib/test/test_unittest/test_case.py ++++ b/Lib/test/test_unittest/test_case.py +@@ -304,7 +304,8 @@ def defaultTestResult(self): + def test(self): + pass + +- Foo('test').run() ++ with self.assertWarns(RuntimeWarning): ++ Foo('test').run() + + def test_deprecation_of_return_val_from_test(self): + # Issue 41322 - deprecate return of value that is not None from a test diff --git a/python3.12.spec b/python3.12.spec index 1654a41..854201c 100644 --- a/python3.12.spec +++ b/python3.12.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a7 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 # Getting this build in Koji on 32bit ARM is frustrating due to technical problems @@ -313,6 +313,10 @@ Patch251: 00251-change-user-install-location.patch # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +# 00398 # 93aeb4f29cff425ea65401e4615236812a40ecd5 +# gh-48330: assert warning is emitted on unittest.TestResult with no addDuration (#103309) +Patch398: 00398-gh-48330-assert-warning-is-emitted-on-unittest-testresult-with-no-addduration-103309.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1583,6 +1587,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Apr 12 2023 Tomáš Hrnčiar - 3.12.0~a7-2 +- Backport patch + * Wed Apr 05 2023 Tomáš Hrnčiar - 3.12.0~a7-1 - Update to 3.12.0a7