mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 20:36:40 +02:00
main/py3-testtools: fix compat with pytest 8.2
Fixes community/py3-stestr tests ref: https://github.com/pytest-dev/pytest/issues/12263#issuecomment-2081434468 ref: https://github.com/mtreinish/stestr/issues/363
This commit is contained in:
parent
8412c1e390
commit
d0bf0a5afd
@ -3,7 +3,7 @@
|
||||
pkgname=py3-testtools
|
||||
_pkgname=testtools
|
||||
pkgver=2.7.1
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Extensions to the Python standard library unit testing framework"
|
||||
url="https://pypi.org/project/testtools"
|
||||
arch="noarch"
|
||||
@ -11,7 +11,8 @@ license="MIT"
|
||||
depends="python3 py3-hatch-vcs py3-fixtures"
|
||||
makedepends="py3-gpep517 py3-setuptools py3-wheel"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
|
||||
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
|
||||
pytest8.2.patch"
|
||||
builddir="$srcdir"/$_pkgname-$pkgver
|
||||
options="!check" # needs community/py3-twisted and testscenarios from pypi
|
||||
|
||||
@ -28,4 +29,5 @@ package() {
|
||||
|
||||
sha512sums="
|
||||
78af1c2af6f93671074dafedeaaf3ddbcc806e78c3153a3b90f88874c967e34a18cb85e5649b08fabb4ba4ae649eeb401e79c77c3b9233d9eee2a3c2267a4596 testtools-2.7.1.tar.gz
|
||||
64151feb16be07260758cc9020fa978a1810b8bbe7fc2f56fc5b6ef6f0ce3ae68c092a57280bca4671f3982bac6254db66cc730e3cae67ece1e85eb2f861f19a pytest8.2.patch
|
||||
"
|
||||
|
||||
23
main/py3-testtools/pytest8.2.patch
Normal file
23
main/py3-testtools/pytest8.2.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff --git a/testtools/testcase.py b/testtools/testcase.py
|
||||
index 004fdb5..b8e9010 100644
|
||||
--- a/testtools/testcase.py
|
||||
+++ b/testtools/testcase.py
|
||||
@@ -693,7 +693,17 @@ class TestCase(unittest.TestCase):
|
||||
|
||||
def _get_test_method(self):
|
||||
method_name = getattr(self, '_testMethodName')
|
||||
- return getattr(self, method_name)
|
||||
+ try:
|
||||
+ m = getattr(self, method_name)
|
||||
+ except AttributeError:
|
||||
+ if method_name != "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__, method_name)
|
||||
+ )
|
||||
+ else:
|
||||
+ return m
|
||||
|
||||
def _run_test_method(self, result):
|
||||
"""Run the test method for this test.
|
||||
Loading…
x
Reference in New Issue
Block a user