[arch-commits] Commit in python-pytest-timeout/trunk (PKGBUILD pytest-2.8.patch)

Felix Yan fyan at archlinux.org
Wed Sep 23 01:05:00 UTC 2015


    Date: Wednesday, September 23, 2015 @ 03:05:00
  Author: fyan
Revision: 141499

upgpkg: python-pytest-timeout 0.5-3

add a patch to fix compatibility with pytest 2.8

Added:
  python-pytest-timeout/trunk/pytest-2.8.patch
Modified:
  python-pytest-timeout/trunk/PKGBUILD

------------------+
 PKGBUILD         |   16 +++++++++-------
 pytest-2.8.patch |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-09-22 22:52:16 UTC (rev 141498)
+++ PKGBUILD	2015-09-23 01:05:00 UTC (rev 141499)
@@ -5,7 +5,7 @@
 pkgname=('python-pytest-timeout' 'python2-pytest-timeout')
 _pypiname=pytest-timeout
 pkgver=0.5
-pkgrel=2
+pkgrel=3
 pkgdesc='py.test plugin to abort hanging tests'
 arch=('any')
 license=('MIT')
@@ -12,10 +12,15 @@
 url='https://bitbucket.org/pytest-dev/pytest-timeout'
 makedepends=('python-pytest' 'python2-pytest' 'mercurial')
 checkdepends=('python-pexpect' 'python2-pexpect')
-source=("hg+https://bitbucket.org/pytest-dev/pytest-timeout#tag=$pkgver")
-md5sums=('SKIP')
+source=("hg+https://bitbucket.org/pytest-dev/pytest-timeout#tag=$pkgver"
+        pytest-2.8.patch)
+md5sums=('SKIP'
+         'aa75f95f3347cdcdd05eba5255ec3c74')
 
 prepare() {
+  # https://bitbucket.org/pytest-dev/pytest-timeout/issues/12/tests-failed-with-pytest-280
+  (cd $_pypiname; patch -p1 -i ../pytest-2.8.patch)
+
   cp -a "${srcdir}/${_pypiname}"{,-py2}
 }
 
@@ -27,7 +32,7 @@
   python2 setup.py build
 }
 
-check() {(
+check() {
   # Hack entry points by installing it
 
   cd "$srcdir/$_pypiname"
@@ -37,9 +42,6 @@
   cd "$srcdir/$_pypiname-py2"
   python2 setup.py install --root="$PWD/tmp_install" --optimize=1
   PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH" py.test2
-  ) || warning "Tests failed"
-  # Tests failed because of pytest 2.8.0, not python 3.5, so let's give upstream some time.
-  # https://bitbucket.org/pytest-dev/pytest-timeout/issues/12/tests-failed-with-pytest-280
 }
 
 package_python-pytest-timeout() {

Added: pytest-2.8.patch
===================================================================
--- pytest-2.8.patch	                        (rev 0)
+++ pytest-2.8.patch	2015-09-23 01:05:00 UTC (rev 141499)
@@ -0,0 +1,50 @@
+# HG changeset patch
+# User holger krekel <holger at merlinux.eu>
+# Date 1442952268 -7200
+# Branch fixpytest28
+# Node ID 5e239034ab0db1b58b96c7f6b38eb55814ee78de
+# Parent  ea3ba7b8f9b3ed4fe75d981f0f98765e71ef7a7a
+fix issue12: force runpytest() to use subprocesses instead of inline running.
+also streamline tox.ini to newly use py35 and scrap py31 and py32 where pytest is
+not aiming for compatibility itself.
+
+diff --git a/test_pytest_timeout.py b/test_pytest_timeout.py
+--- a/test_pytest_timeout.py
++++ b/test_pytest_timeout.py
+@@ -5,13 +5,19 @@
+ 
+ import pytest
+ 
+-
+ pytest_plugins = 'pytester'
+ 
+-
+ have_sigalrm = pytest.mark.skipif(not hasattr(signal, "SIGALRM"),
+                                   reason='OS does not have SIGALRM')
+ 
++ at pytest.fixture
++def testdir(testdir):
++    if hasattr(testdir, "runpytest_subprocess"):
++        # on pytest-2.8 runpytest runs inline by default
++        # patch the testdir instance to use the subprocess method
++        testdir.runpytest = testdir.runpytest_subprocess
++    return testdir
++
+ 
+ @have_sigalrm
+ def test_sigalrm(testdir):
+diff --git a/tox.ini b/tox.ini
+--- a/tox.ini
++++ b/tox.ini
+@@ -3,9 +3,9 @@
+ addopts = -rxs
+ 
+ [tox]
+-envlist = py26,py27,py31,py32,py33,py34,pypy,pypy3
++envlist = py26,py27,py33,py34,py35,pypy,pypy3
+ 
+ [testenv]
+ deps = pytest
+     pexpect
+-commands = py.test []
++commands = py.test {posargs}



More information about the arch-commits mailing list