summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@gentoo.org>2024-07-01 14:41:02 +0200
committerPetr Vaněk <arkamar@gentoo.org>2024-07-01 15:14:00 +0200
commit3efda587bb8a8816f04ce2f9a056d57bb94f960e (patch)
tree03cc149f406303d29ea8494cf8c9a7cb1885f1c6 /dev-python/testtools
parentmedia-sound/vkeybd: dropped obsolete 0.1.18.d (diff)
downloadgentoo-3efda587bb8a8816f04ce2f9a056d57bb94f960e.tar.gz
gentoo-3efda587bb8a8816f04ce2f9a056d57bb94f960e.tar.bz2
gentoo-3efda587bb8a8816f04ce2f9a056d57bb94f960e.zip
dev-python/testtools: extend twisted test dep to py3.13
Some tests need to be addapted for dev-python/twisted-24.3.0_p20240628 snapshot we have in our tree. The patch is backported from upstream. Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
Diffstat (limited to 'dev-python/testtools')
-rw-r--r--dev-python/testtools/files/testtools-2.7.2-twisted-fix.patch45
-rw-r--r--dev-python/testtools/testtools-2.7.2.ebuild8
2 files changed, 50 insertions, 3 deletions
diff --git a/dev-python/testtools/files/testtools-2.7.2-twisted-fix.patch b/dev-python/testtools/files/testtools-2.7.2-twisted-fix.patch
new file mode 100644
index 000000000000..bbf943be60d1
--- /dev/null
+++ b/dev-python/testtools/files/testtools-2.7.2-twisted-fix.patch
@@ -0,0 +1,45 @@
+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
+
+Upstream-PR: https://github.com/testing-cabal/testtools/pull/387
+
+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/dev-python/testtools/testtools-2.7.2.ebuild b/dev-python/testtools/testtools-2.7.2.ebuild
index f9c9a6886024..d26da3f05732 100644
--- a/dev-python/testtools/testtools-2.7.2.ebuild
+++ b/dev-python/testtools/testtools-2.7.2.ebuild
@@ -27,12 +27,14 @@ BDEPEND="
>=dev-python/fixtures-2.0.0[${PYTHON_USEDEP}]
dev-python/testscenarios[${PYTHON_USEDEP}]
dev-python/testresources[${PYTHON_USEDEP}]
- $(python_gen_cond_dep '
- dev-python/twisted[${PYTHON_USEDEP}]
- ' 3.{10..12})
+ dev-python/twisted[${PYTHON_USEDEP}]
)
"
+PATCHES=(
+ "${FILESDIR}/${PN}-2.7.2-twisted-fix.patch"
+)
+
distutils_enable_sphinx doc
python_test() {