From f299a856fa3efbb779ba00f6c5d79b9e7b83aed3 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sat, 6 Apr 2024 21:21:57 +0200 Subject: [PATCH] testing/py3-wstools: fix running tests with python 3.12 --- testing/py3-wstools/APKBUILD | 2 ++ testing/py3-wstools/python3.12-support.patch | 22 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 testing/py3-wstools/python3.12-support.patch diff --git a/testing/py3-wstools/APKBUILD b/testing/py3-wstools/APKBUILD index 9d97e836dcc..a1904138ad1 100644 --- a/testing/py3-wstools/APKBUILD +++ b/testing/py3-wstools/APKBUILD @@ -13,6 +13,7 @@ checkdepends="py3-pytest" subpackages="$pkgname-pyc" source="$pkgname-$pkgver.tar.gz::https://github.com/pycontribs/wstools/archive/$pkgver.tar.gz python3.10-support.patch + python3.12-support.patch " builddir="$srcdir/wstools-$pkgver" @@ -32,4 +33,5 @@ package() { sha512sums=" 1acd8e62d71c7d330f1e953a0da1956291c5dfb25ff9b8b8799c83feaa4230e384955735b131bab7b430b92ae6c18498927d416d2d1e11fb5c5dad93417c671a py3-wstools-0.4.10.tar.gz 9c19ae50724249dacb91206301417238c04df3afd841fe5b3ef2280dfd57ce635e01690e6d28c88798aebc6b7b2bea7a83eeb1f45eeb07bb94ddcd00d3c6ed94 python3.10-support.patch +64e25d87337d27ef36d9d97702001f2fb87e0215b93b8a03653dbed2331b10b44963eeddbe508813d9fbd0ba1727b68a0fe3d181855d548014df4f8f5cbe53c2 python3.12-support.patch " diff --git a/testing/py3-wstools/python3.12-support.patch b/testing/py3-wstools/python3.12-support.patch new file mode 100644 index 00000000000..231b66a6530 --- /dev/null +++ b/testing/py3-wstools/python3.12-support.patch @@ -0,0 +1,22 @@ +diff --git a/tests/test_wsdl.py b/tests/test_wsdl.py +index aeeddf7..8cfa7fb 100755 +--- a/tests/test_wsdl.py ++++ b/tests/test_wsdl.py +@@ -70,7 +70,7 @@ class WSDLToolsTestCase(unittest.TestCase): + for node in DOM.getElements(definition, tag_name, nspname): + name = DOM.getAttr(node, key) + comp = component[name] # noqa F841 +- self.failUnlessEqual(eval('comp.%s' % key), name) ++ self.assertEqual(eval('comp.%s' % key), name) + + def checkXSDCollection(self, tag_name, component, node, key='name'): + for cnode in DOM.getElements(node, tag_name): +@@ -126,7 +126,7 @@ class WSDLToolsTestCase(unittest.TestCase): + try: + for key in self.wsdl.types.keys(): + schema = self.wsdl.types[key] +- self.failUnlessEqual(key, schema.getTargetNamespace()) ++ self.assertEqual(key, schema.getTargetNamespace()) + + definition = self.wsdl.document.documentElement + version = DOM.WSDLUriToVersion(definition.namespaceURI)