[arch-commits] Commit in python-apipkg/trunk (PKGBUILD apipkg-pytest5.patch)
Antonio Rojas
arojas at archlinux.org
Fri Nov 1 12:57:53 UTC 2019
Date: Friday, November 1, 2019 @ 12:57:52
Author: arojas
Revision: 521771
Fix tests with pytest 5.1
Added:
python-apipkg/trunk/apipkg-pytest5.patch
Modified:
python-apipkg/trunk/PKGBUILD
----------------------+
PKGBUILD | 13 ++++++++++---
apipkg-pytest5.patch | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-11-01 11:36:56 UTC (rev 521770)
+++ PKGBUILD 2019-11-01 12:57:52 UTC (rev 521771)
@@ -7,12 +7,19 @@
pkgdesc="Namespace control and lazy-import mechanism"
arch=('any')
license=('MIT')
-url="https://bitbucket.org/hpk42/apipkg"
+url="https://github.com/pytest-dev/apipkg"
makedepends=('python-setuptools' 'python2-setuptools')
checkdepends=('python-pytest-runner' 'python2-pytest-runner')
-source=("https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-$pkgver.tar.gz")
-sha512sums=('828937ca5e203915248fac54db8e7c13f941e006403f2a415c27fa4d1aa114790be3d7b5dd892f528611e5e6dfe75114ee80f4f4589a03c3f789ae6ddfcae0bf')
+source=("https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-$pkgver.tar.gz"
+ apipkg-pytest5.patch)
+sha512sums=('828937ca5e203915248fac54db8e7c13f941e006403f2a415c27fa4d1aa114790be3d7b5dd892f528611e5e6dfe75114ee80f4f4589a03c3f789ae6ddfcae0bf'
+ '1228d7c8c79ea1a0d136585bfe236bc8c22a4053c044602082d9f88006ba2893dd615399e3bae0bbf7f94c719cc9d61d578bc8c8c956cb6f3ff3de3e0c00f7d6')
+prepare() {
+ cd apipkg-$pkgver
+ patch -p1 -i ../apipkg-pytest5.patch # port away from removed pytest api
+}
+
build() {
cd apipkg-$pkgver
python setup.py build
Added: apipkg-pytest5.patch
===================================================================
--- apipkg-pytest5.patch (rev 0)
+++ apipkg-pytest5.patch 2019-11-01 12:57:52 UTC (rev 521771)
@@ -0,0 +1,42 @@
+diff --git a/test_apipkg.py b/test_apipkg.py
+index 2b7ca1b..ce75aee 100644
+--- a/test_apipkg.py
++++ b/test_apipkg.py
+@@ -13,7 +13,7 @@ ModuleType = types.ModuleType
+ class TestRealModule:
+
+ def setup_class(cls):
+- cls.tmpdir = py.test.ensuretemp('test_apipkg')
++ cls.tmpdir = py.path.local('test_apipkg')
+ sys.path = [str(cls.tmpdir)] + sys.path
+ pkgdir = cls.tmpdir.ensure('realtest', dir=1)
+
+@@ -319,10 +319,12 @@ def test_error_loading_one_element(monkeypatch, tmpdir):
+ import errorloading1
+ assert isinstance(errorloading1, apipkg.ApiModule)
+ assert errorloading1.y == 0
+- py.test.raises(ImportError, 'errorloading1.x')
+- py.test.raises(ImportError, 'errorloading1.x')
+-
+-
++ try:
++ errorloading1.x
++ except ImportError:
++ pass
++
++
+ def test_onfirstaccess(tmpdir, monkeypatch):
+ pkgdir = tmpdir.mkdir("firstaccess")
+ pkgdir.join('__init__.py').write(py.code.Source("""
+@@ -493,7 +495,10 @@ def test_aliasmodule_proxy_methods(tmpdir, monkeypatch):
+ assert doit is orig.doit
+
+ del proxy.doit
+- py.test.raises(AttributeError, "orig.doit")
++ try:
++ orig.doit
++ except AttributeError:
++ pass
+
+ proxy.doit = doit
+ assert orig.doit is doit
More information about the arch-commits
mailing list