dev-python/pytest: Add PyPy test fix from Debian
authorMichał Górny <mgorny@gentoo.org>
Wed, 11 Jul 2018 17:35:50 +0000 (19:35 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 11 Jul 2018 22:11:19 +0000 (00:11 +0200)
Thanks to sbraz for finding the patch.

dev-python/pytest/files/pytest-3.4.2-pypy-syntaxerror-offset.patch [new file with mode: 0644]
dev-python/pytest/pytest-3.4.2.ebuild

diff --git a/dev-python/pytest/files/pytest-3.4.2-pypy-syntaxerror-offset.patch b/dev-python/pytest/files/pytest-3.4.2-pypy-syntaxerror-offset.patch
new file mode 100644 (file)
index 0000000..622be56
--- /dev/null
@@ -0,0 +1,27 @@
+https://salsa.debian.org/python-team/modules/pytest/commit/405c05a0827592515de76e23c94de1f7773273e6.patch
+
+From 405c05a0827592515de76e23c94de1f7773273e6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= <onovy@debian.org>
+Date: Thu, 10 May 2018 11:42:56 +0200
+Subject: [PATCH] Fix PyPy SyntaxError offset in tests
+
+---
+ testing/code/test_source.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testing/code/test_source.py b/testing/code/test_source.py
+index fcce3fa..22278d8 100644
+--- a/testing/code/test_source.py
++++ b/testing/code/test_source.py
+@@ -117,7 +117,7 @@ def test_source_strip_multiline():
+ def test_syntaxerror_rerepresentation():
+     ex = pytest.raises(SyntaxError, _pytest._code.compile, 'xyz xyz')
+     assert ex.value.lineno == 1
+-    assert ex.value.offset in (4, 7)  # XXX pypy/jython versus cpython?
++    assert ex.value.offset in (4, 5, 7)  # XXX pypy/jython versus cpython?
+     assert ex.value.text.strip(), 'x x'
+-- 
+2.18.0
+
index c543591cc90deb3f549887c5206fb876d04e780f..9fb19f1d81bf1f85b46836dcf206c280cab9ebaa 100644 (file)
@@ -45,6 +45,10 @@ RDEPEND="
        !<dev-python/logilab-common-1.3.0"
 
 python_prepare_all() {
+       local PATCHES=(
+               "${FILESDIR}"/pytest-3.4.2-pypy-syntaxerror-offset.patch
+       )
+
        chmod o-w *egg*/* || die
        # Disable versioning of py.test script to avoid collision with
        # versioning performed by the eclass.