From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1280315810D for ; Wed, 31 May 2023 10:50:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 231DBE08C0; Wed, 31 May 2023 10:50:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 09384E08C0 for ; Wed, 31 May 2023 10:50:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3531D340F54 for ; Wed, 31 May 2023 10:50:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8FDA8A81 for ; Wed, 31 May 2023 10:50:05 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1685530197.3a9c94a884fa08182efa8cb2de4a9357e7c73c53.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/testresources/files/, dev-python/testresources/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/testresources/files/testresources-2.0.1-py312-tests.patch dev-python/testresources/testresources-2.0.1-r3.ebuild X-VCS-Directories: dev-python/testresources/ dev-python/testresources/files/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 3a9c94a884fa08182efa8cb2de4a9357e7c73c53 X-VCS-Branch: master Date: Wed, 31 May 2023 10:50:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5b152e12-cb5c-4f9c-84ab-6452728da31d X-Archives-Hash: 36ea09196b81c1587636901e46000aec commit: 3a9c94a884fa08182efa8cb2de4a9357e7c73c53 Author: Petr Vaněk atlas cz> AuthorDate: Tue May 30 19:46:26 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed May 31 10:49:57 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a9c94a8 dev-python/testresources: enable py3.12 It was necessary to patch two tests due to removed failIf method in py3.12. Upstream-PR: https://github.com/testing-cabal/testresources/pull/15 Signed-off-by: Petr Vaněk atlas.cz> Signed-off-by: Michał Górny gentoo.org> .../files/testresources-2.0.1-py312-tests.patch | 35 ++++++++++++++++++++ .../testresources/testresources-2.0.1-r3.ebuild | 37 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/dev-python/testresources/files/testresources-2.0.1-py312-tests.patch b/dev-python/testresources/files/testresources-2.0.1-py312-tests.patch new file mode 100644 index 000000000000..7d4451ca43b9 --- /dev/null +++ b/dev-python/testresources/files/testresources-2.0.1-py312-tests.patch @@ -0,0 +1,35 @@ +Subject: [PATCH] Refactor failIf to assertFalse for Python 3.12 Compatibility + +This commit replaces deprecated failIf calls with assertFalse in the +test_resourced_test_case.py file. The failIf method was removed in +Python 3.12 [1-3]. + +[1] https://docs.python.org/3.12/whatsnew/3.12.html#removed +[2] https://github.com/python/cpython/issues/89325 +[3] https://github.com/python/cpython/pull/28268 + +Upstream-PR: https://github.com/testing-cabal/testresources/pull/15 + +diff --git a/testresources/tests/test_resourced_test_case.py b/testresources/tests/test_resourced_test_case.py +index 7d2cfba..3c8a1b3 100644 +--- a/testresources/tests/test_resourced_test_case.py ++++ b/testresources/tests/test_resourced_test_case.py +@@ -129,7 +129,7 @@ class TestResourcedTestCase(testtools.TestCase): + self.resourced_case.resources = [("foo", self.resource_manager)] + self.resourced_case.setUpResources() + self.resourced_case.tearDownResources() +- self.failIf(hasattr(self.resourced_case, "foo")) ++ self.assertFalse(hasattr(self.resourced_case, "foo")) + + def testTearDownResourcesStopsUsingResource(self): + # tearDownResources records that there is one less use of each +@@ -158,5 +158,5 @@ class TestResourcedTestCase(testtools.TestCase): + self.assertEqual(self.resourced_case.foo, self.resource) + self.assertEqual(self.resource_manager._uses, 1) + self.resourced_case.tearDown() +- self.failIf(hasattr(self.resourced_case, "foo")) ++ self.assertFalse(hasattr(self.resourced_case, "foo")) + self.assertEqual(self.resource_manager._uses, 0) +-- +2.39.2 + diff --git a/dev-python/testresources/testresources-2.0.1-r3.ebuild b/dev-python/testresources/testresources-2.0.1-r3.ebuild new file mode 100644 index 000000000000..30c055507529 --- /dev/null +++ b/dev-python/testresources/testresources-2.0.1-r3.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} pypy3 ) + +inherit distutils-r1 pypi + +DESCRIPTION="A pyunit extension for managing expensive test resources" +HOMEPAGE=" + https://launchpad.net/testresources/ + https://github.com/testing-cabal/testresources/ + https://pypi.org/project/testresources/ +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" + +RDEPEND=" + dev-python/pbr[${PYTHON_USEDEP}] +" +BDEPEND=" + dev-python/pbr[${PYTHON_USEDEP}] + test? ( + dev-python/testtools[${PYTHON_USEDEP}] + dev-python/fixtures[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/${P}-py312-tests.patch" +) + +distutils_enable_tests unittest