Date: Friday, November 1, 2019 @ 15:36:03 Author: foutrelis Revision: 522050
Add upstream fix for pytest 5 Added: python-iniconfig/trunk/pytest5.patch Modified: python-iniconfig/trunk/PKGBUILD ---------------+ PKGBUILD | 7 +++++-- pytest5.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-11-01 15:29:16 UTC (rev 522049) +++ PKGBUILD 2019-11-01 15:36:03 UTC (rev 522050) @@ -11,10 +11,13 @@ makedepends=('python-setuptools' 'python2-setuptools' 'python-setuptools-scm' 'python2-setuptools-scm') checkdepends=('python-pytest-runner' 'python2-pytest-runner') -source=("$pkgbase-$pkgver.tar.gz::https://github.com/RonnyPfannschmidt/iniconfig/archive/v$pkgver.tar.gz") -sha512sums=('d8048af40145a5312784c5d1a9afaa052528ffdef56e47aa9be7f727d946426a43b8e934edce6b46024b83771c151ef544787e8422c74adeda2ccc8913aedd5c') +source=("$pkgbase-$pkgver.tar.gz::https://github.com/RonnyPfannschmidt/iniconfig/archive/v$pkgver.tar.gz" + 'pytest5.patch') +sha512sums=('d8048af40145a5312784c5d1a9afaa052528ffdef56e47aa9be7f727d946426a43b8e934edce6b46024b83771c151ef544787e8422c74adeda2ccc8913aedd5c' + 'db500dcdbc358db130569c8f7a199e34b37a4f0693dc99064fdcc4f7968048f118f942bed84332c4399fea9f64d1d84ed5e3502ba26e48e7290d2ca31ea87638') prepare() { + patch -Np1 -d iniconfig-$pkgver <pytest5.patch cp -a iniconfig-$pkgver{,-py2} export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver Added: pytest5.patch =================================================================== --- pytest5.patch (rev 0) +++ pytest5.patch 2019-11-01 15:36:03 UTC (rev 522050) @@ -0,0 +1,54 @@ +From 41076a67c333d96be14557ecbb29995f98744bd7 Mon Sep 17 00:00:00 2001 +From: Stanislav Levin <s...@altlinux.org> +Date: Thu, 8 Aug 2019 19:43:12 +0300 +Subject: [PATCH] Fix Pytest 5 errors + +This fixes +""" +pytest.PytestDeprecationWarning: raises(..., 'code(as_a_string)') +is deprecated, use the context manager form or use `exec()` directly. +""" + +Fixes: https://github.com/RonnyPfannschmidt/iniconfig/issues/6 +Signed-off-by: Stanislav Levin <s...@altlinux.org> +--- + test_iniconfig.py | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/test_iniconfig.py b/test_iniconfig.py +index 27fd53f..fe12421 100644 +--- a/test_iniconfig.py ++++ b/test_iniconfig.py +@@ -150,27 +150,25 @@ def test_iniconfig_from_file(tmpdir): + assert list(config.sections) == ['metadata'] + config = IniConfig(path, "[diff]") + assert list(config.sections) == ['diff'] +- py.test.raises(TypeError, "IniConfig(data=path.read())") ++ with pytest.raises(TypeError): ++ IniConfig(data=path.read()) + + + def test_iniconfig_section_first(tmpdir): +- excinfo = py.test.raises(ParseError, """ ++ with pytest.raises(ParseError) as excinfo: + IniConfig("x", data='name=1') +- """) + assert excinfo.value.msg == "no section header defined" + + + def test_iniconig_section_duplicate_fails(): +- excinfo = py.test.raises(ParseError, r""" ++ with pytest.raises(ParseError) as excinfo: + IniConfig("x", data='[section]\n[section]') +- """) + assert 'duplicate section' in str(excinfo.value) + + + def test_iniconfig_duplicate_key_fails(): +- excinfo = py.test.raises(ParseError, r""" ++ with pytest.raises(ParseError) as excinfo: + IniConfig("x", data='[section]\nname = Alice\nname = bob') +- """) + + assert 'duplicate name' in str(excinfo.value) +