forked from pool/python-testtools
Accepting request 1202887 from home:mcalabkova:branches:devel:languages:python
- Update to 2.7.2 * Treat methodName="runTest" similar to unittest.TestCase, fixes compatibility with pytest 8.3. (Natanael Copa, #372) * Use ruff for linting. (Jelmer Vernooij) * Fix compatibility with Python 3.12.1. (Matthew Treinish) * Deprecate SkippedTest exception. (Stephen Finucane) * Drop support for Python 3.7. (Jelmer Vernooij) - Drop merged pytest82.patch - Add upstream twisted.patch to fix tests with new Twisted OBS-URL: https://build.opensuse.org/request/show/1202887 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=86
This commit is contained in:
46
twisted.patch
Normal file
46
twisted.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 5b8cb6497c7159f593e68de6a13e15f7e78e56e3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz>
|
||||
Date: Mon, 1 Jul 2024 10:00:05 +0200
|
||||
Subject: [PATCH] Prepare tests for upcoming twisted version
|
||||
|
||||
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):
|
Reference in New Issue
Block a user