Backport upstream commit to fix RuntimeWarning: TestResult has no addDuration method

This commit is contained in:
Tomáš Hrnčiar 2023-04-12 16:47:41 +02:00
commit a56582a9f7
2 changed files with 32 additions and 1 deletions

View file

@ -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

View file

@ -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 <thrnciar@redhat.com> - 3.12.0~a7-2
- Backport patch
* Wed Apr 05 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0~a7-1
- Update to 3.12.0a7