diff options
Diffstat (limited to 'dev-python/testresources')
-rw-r--r-- | dev-python/testresources/files/testresources-2.0.1-py312-tests.patch | 35 | ||||
-rw-r--r-- | dev-python/testresources/metadata.xml | 3 | ||||
-rw-r--r-- | dev-python/testresources/testresources-2.0.1-r3.ebuild (renamed from dev-python/testresources/testresources-2.0.1-r2.ebuild) | 16 |
3 files changed, 43 insertions, 11 deletions
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/metadata.xml b/dev-python/testresources/metadata.xml index db9726aac1d4..dae62b0347a1 100644 --- a/dev-python/testresources/metadata.xml +++ b/dev-python/testresources/metadata.xml @@ -21,7 +21,8 @@ </longdescription> <stabilize-allarches/> <upstream> - <remote-id type="pypi">testresources</remote-id> + <remote-id type="github">testing-cabal/testresources</remote-id> <remote-id type="launchpad">testresources</remote-id> + <remote-id type="pypi">testresources</remote-id> </upstream> </pkgmetadata> diff --git a/dev-python/testresources/testresources-2.0.1-r2.ebuild b/dev-python/testresources/testresources-2.0.1-r3.ebuild index 31900c7b8cf1..9d28740da7fd 100644 --- a/dev-python/testresources/testresources-2.0.1-r2.ebuild +++ b/dev-python/testresources/testresources-2.0.1-r3.ebuild @@ -4,9 +4,9 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..11} pypy3 ) +PYTHON_COMPAT=( python3_{10..12} pypy3 ) -inherit distutils-r1 +inherit distutils-r1 pypi DESCRIPTION="A pyunit extension for managing expensive test resources" HOMEPAGE=" @@ -14,7 +14,6 @@ HOMEPAGE=" https://github.com/testing-cabal/testresources/ https://pypi.org/project/testresources/ " -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" LICENSE="Apache-2.0" SLOT="0" @@ -31,11 +30,8 @@ BDEPEND=" ) " -distutils_enable_tests unittest +PATCHES=( + "${FILESDIR}/${P}-py312-tests.patch" +) -python_prepare_all() { -# sed \ -# -e 's:testBasicSortTests:_&:g' \ -# -i testresources/tests/test_optimising_test_suite.py || die - distutils-r1_python_prepare_all -} +distutils_enable_tests unittest |