diff --git a/Prepare-tests-for-upcoming-twisted-version.patch b/Prepare-tests-for-upcoming-twisted-version.patch new file mode 100644 index 0000000000000000000000000000000000000000..20e8c40ab28f7cb51aa6a640b348004f9a14353c --- /dev/null +++ b/Prepare-tests-for-upcoming-twisted-version.patch @@ -0,0 +1,46 @@ +From 5b8cb6497c7159f593e68de6a13e15f7e78e56e3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Van=C4=9Bk?= +Date: Mon, 1 Jul 2024 10:00:05 +0200 +Subject: [PATCH] Prepare tests for upcoming twisted version +Origin:https://github.com/testing-cabal/testtools/commit/5b8cb6497c7159f593e68de6a13e15f7e78e56e3.patch +Twisted recently changed behavior of logger on failures [1]. It newly +logs the `Main loop terminated.` even on exceptions, which breaks two +test in twistedsupport test suite. This hack attempts to address the +upcoming issue. + +[1] https://github.com/twisted/twisted/pull/12207 +--- + testtools/tests/twistedsupport/test_runtest.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/testtools/tests/twistedsupport/test_runtest.py b/testtools/tests/twistedsupport/test_runtest.py +index 4b46cc64..f8faf7c6 100644 +--- a/testtools/tests/twistedsupport/test_runtest.py ++++ b/testtools/tests/twistedsupport/test_runtest.py +@@ -16,7 +16,6 @@ + Contains, + ContainsAll, + ContainsDict, +- EndsWith, + Equals, + Is, + KeysEqual, +@@ -749,7 +748,7 @@ def test_something(self): + test, + { + "traceback": Not(Is(None)), +- "twisted-log": AsText(EndsWith(" foo\n")), ++ "twisted-log": AsText(Contains(" foo\n")), + }, + ), + ("stopTest", test), +@@ -790,7 +789,8 @@ def test_something(self): + result = self.make_result() + runner.run(result) + self.assertThat( +- messages, MatchesListwise([ContainsDict({"message": Equals(("foo",))})]) ++ messages[0:1], ++ MatchesListwise([ContainsDict({"message": Equals(("foo",))})]), + ) + + def test_restore_observers(self): diff --git a/python-testtools.spec b/python-testtools.spec index afb8a95f2d8e1da67d60b024624dfbe782a7b73a..0bec15fa36112ff0b8c72e37f19ca3f4d979706e 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -1,11 +1,12 @@ Name: python-testtools Version: 2.7.2 -Release: 1 +Release: 2 Summary: Extensions to the Python unit testing framework License: MIT URL: https://launchpad.net/testtools Source0: https://pypi.io/packages/source/t/testtools/testtools-%{version}.tar.gz +Patch0: Prepare-tests-for-upcoming-twisted-version.patch BuildRequires: python3-extras python3-mimeparse python3-pbr python3-setuptools python3-unittest2 BuildRequires: python3-traceback2 python3-testscenarios python3-sphinx python3-devel BuildRequires: python3-twisted python3-pip python3-wheel python3-hatchling python3-hatch-vcs @@ -59,6 +60,9 @@ export PYTHONPATH=%{buildroot}%{python3_sitelib} %doc doc/_build/html/* %changelog +* Wed Aug 06 2025 zhang_wenyu - 2.7.2-2 +- Fix test_log_in_details failed + * Fri Nov 29 2024 Ge Wang - 2.7.2-1 - Update to 2.7.2