diff options
Diffstat (limited to 'dev-python/tornado')
-rw-r--r-- | dev-python/tornado/Manifest | 3 | ||||
-rw-r--r-- | dev-python/tornado/files/tornado-6.4-pytest-8.2.patch | 66 | ||||
-rw-r--r-- | dev-python/tornado/tornado-6.4-r1.ebuild (renamed from dev-python/tornado/tornado-6.4.ebuild) | 8 |
3 files changed, 73 insertions, 4 deletions
diff --git a/dev-python/tornado/Manifest b/dev-python/tornado/Manifest index c9877c7c9f2f..96632611e4bd 100644 --- a/dev-python/tornado/Manifest +++ b/dev-python/tornado/Manifest @@ -1,5 +1,6 @@ AUX tornado-6.3.2-ignore-deprecationwarning.patch 656 BLAKE2B a64b3b5f021f4e1939c69f20fe93ef61eb64666b083773c1fa189af03d0964b8832a97d49ce18924f9e1202f26bb85b76d182f2baaa8265d0e1a2decbd12efef SHA512 5cd0258db519ec2a02a9988160a345c94ffb2abae92a78fb8e9d3eb6017bac8ecb86f4ef0e3eedb5ea561344213850e2b342a1f6517c909a3c6a0224606f2afd AUX tornado-6.3.2-test-timeout-increase.patch 521 BLAKE2B 9d3b5d8a380178f84146e7909a6557c28c48df775abb96afadbe4a06a7b565d5c32f39359060fd45028120c8952238f95fca3348e225096784e806864cfd2b7a SHA512 00a964cd75224195e8de77bc7137c087c6f4128734a9c55505ef4d88d512deb0325df56e3da4c8fefac10915613e1dc244c9107123a22bc9f124fa515fae9f4a +AUX tornado-6.4-pytest-8.2.patch 2763 BLAKE2B a4f416ac403f8a1f616c7a3e2e97c74919242424d829249f302f9ecd0779f96244b33d5e17e441592d315b014c8b94ce9efef32ea54919c6b6545c3cdfa7041d SHA512 a252f8276b503f5f96f0059f3a75ca480b9f99542cf88066aff4ec020f091acb7826222441538f010a7a2ac1c0a9b423630eb8fcff54be89ef30f998d11e7e3a DIST tornado-6.4.tar.gz 498845 BLAKE2B ebcdcfa93490107addfe69f722e2d85058a92fc366b09a4794a4d6e0a93040ef9791095a5a94d21937d4e88dea09521644cf92d0f2c7e98238dc58e6b864a009 SHA512 c063509d4c385e410c63cccdc1e9c66aa2bb739473667ede56cb801b7379b910c8059dec831d609109f3076222b588b257afd960dffa422d7a872867dcdda7c7 -EBUILD tornado-6.4.ebuild 1460 BLAKE2B cec2feff3821473a9fea14ef30dcece29487969557634d3c34042a75261d1d51235108a7572c8f4f04474f0b354910ff19c9072d50050170e45a29ad8080c19a SHA512 2f164f6580789929da7a7c677d567290c96c5627ab190d37777587c07acdfd396b845a566ca7dc3f7cafbef0d34dd7fce95cd736cc30cc90053de4b238e3023a +EBUILD tornado-6.4-r1.ebuild 1548 BLAKE2B 2a4698ebfc560294f4c5415252194ab7708afa5f567fc22812d0cf1292a220fc8ea5590ea212c0b7d4019a32fa43464c49819bb2d96be4c8a0b2b0582c548e05 SHA512 813352059ced6a29ea25d543db2757695be0635d6dc58713d0750a6f6379778db805368200dd6dc5d2b325d2318aff670281f1cda842bfcc50af1921aaff0461 MISC metadata.xml 381 BLAKE2B 96d5942b11b6364eeac2248f6e92a9e7a54094ba2b6e9ef966be4143e1fa01fa0c417027d33a71c51bb094b905b9ff79e05107e1a9debb4b1ef932ba11fd8565 SHA512 cd4db13e0c6a9cf8b3c788c53dc5ecd0dce2cf783e7b2d67dba71299d1c6a3d1dd2c2a76c0d69816ab0da4ca23f831613323c55864fd858690c605da5426bf60 diff --git a/dev-python/tornado/files/tornado-6.4-pytest-8.2.patch b/dev-python/tornado/files/tornado-6.4-pytest-8.2.patch new file mode 100644 index 000000000000..21a2ed04d24a --- /dev/null +++ b/dev-python/tornado/files/tornado-6.4-pytest-8.2.patch @@ -0,0 +1,66 @@ +From c851aa8a949524b35f72c82b45a52353aa3c0558 Mon Sep 17 00:00:00 2001 +From: Ran Benita <ran@unusedvar.com> +Date: Sun, 28 Apr 2024 14:17:54 +0300 +Subject: [PATCH] testing: allow to instantiate an empty AsyncTestCase + +`unittest.TestCase` has a feature where it allows instantiating +`MyTestClass()` with the default method name `runTest` even if a +`runTest` method doesn't actually exist. This is documented in +`TestCase`'s docs under "Changed in version 3.2"[0]. + +Since version 8.2, pytest relies on this, and started breaking on +Tornado's `AsyncTestCase`[1]. + +Change `AsyncTestCase` to allow empty instatiation, by matching the +upstream code. + +[0] https://docs.python.org/3/library/unittest.html#unittest.TestCase +[1] https://github.com/pytest-dev/pytest/issues/12263 +--- + tornado/test/testing_test.py | 9 +++++++++ + tornado/testing.py | 12 +++++++++++- + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/tornado/test/testing_test.py b/tornado/test/testing_test.py +index 0429feee83..8e2b8db428 100644 +--- a/tornado/test/testing_test.py ++++ b/tornado/test/testing_test.py +@@ -61,6 +61,15 @@ def test_subsequent_wait_calls(self): + self.io_loop.add_timeout(self.io_loop.time() + 0.2, self.stop) + self.wait(timeout=0.4) + ++ def test_empty_instantation_is_allowed(self): ++ """ ++ Test that empty instatiation of an AsyncTestCase is allowed. ++ ++ unittest.TestCase docs guarantee this working, and pytest's unittest ++ support relies on it. ++ """ ++ AsyncTestCaseTest() ++ + + class LeakTest(AsyncTestCase): + def tearDown(self): +diff --git a/tornado/testing.py b/tornado/testing.py +index bdbff87bc3..9455411a6d 100644 +--- a/tornado/testing.py ++++ b/tornado/testing.py +@@ -177,7 +177,17 @@ def __init__(self, methodName: str = "runTest") -> None: + # the test will silently be ignored because nothing will consume + # the generator. Replace the test method with a wrapper that will + # make sure it's not an undecorated generator. +- setattr(self, methodName, _TestMethodWrapper(getattr(self, methodName))) ++ try: ++ test_method = getattr(self, methodName) ++ except AttributeError: ++ if methodName != "runTest": ++ # We allow instantiation with no explicit method name ++ # but not an *incorrect* or missing method name. ++ raise ValueError( ++ "no such test method in %s: %s" % (self.__class__, methodName) ++ ) ++ else: ++ setattr(self, methodName, _TestMethodWrapper(test_method)) + + # Not used in this class itself, but used by @gen_test + self._test_generator = None # type: Optional[Union[Generator, Coroutine]] diff --git a/dev-python/tornado/tornado-6.4.ebuild b/dev-python/tornado/tornado-6.4-r1.ebuild index f5e0af488e82..3b5a869d5c2b 100644 --- a/dev-python/tornado/tornado-6.4.ebuild +++ b/dev-python/tornado/tornado-6.4-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -36,8 +36,10 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}"/${PN}-6.3.2-test-timeout-increase.patch - "${FILESDIR}"/${PN}-6.3.2-ignore-deprecationwarning.patch + "${FILESDIR}/${PN}-6.3.2-test-timeout-increase.patch" + "${FILESDIR}/${PN}-6.3.2-ignore-deprecationwarning.patch" + # https://github.com/tornadoweb/tornado/pull/3374 + "${FILESDIR}/${P}-pytest-8.2.patch" ) src_prepare() { |