diff --git a/pytest4.patch b/pytest4.patch new file mode 100644 index 0000000..9f5bcd2 --- /dev/null +++ b/pytest4.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User Bruno Oliveira +# Date 1542370558 7200 +# Node ID 36998c891573d8ec1db1acd4f9438cb3cf2aee2e +# Parent 753c5f39d2a8d1477ea8653ca7c7bdbdca1efafc +Change tests to use pytest.param + +diff --git a/test_pytest_timeout.py b/test_pytest_timeout.py +--- a/test_pytest_timeout.py ++++ b/test_pytest_timeout.py +@@ -93,7 +93,7 @@ + # assert 'Timeout' in result.stdout.str() + result.stderr.str() + + +-@pytest.mark.parametrize('meth', [have_sigalrm('signal'), 'thread']) ++@pytest.mark.parametrize('meth', [pytest.param('signal', marks=have_sigalrm), 'thread']) + @pytest.mark.parametrize('scope', ['function', 'class', 'module', 'session']) + def test_fix_setup(meth, scope, testdir): + testdir.makepyfile(""" +@@ -133,7 +133,7 @@ + assert 'Timeout' not in result.stdout.str() + result.stderr.str() + + +-@pytest.mark.parametrize('meth', [have_sigalrm('signal'), 'thread']) ++@pytest.mark.parametrize('meth', [pytest.param('signal', marks=have_sigalrm), 'thread']) + @pytest.mark.parametrize('scope', ['function', 'class', 'module', 'session']) + def test_fix_finalizer(meth, scope, testdir): + testdir.makepyfile(""" diff --git a/python-pytest-timeout.spec b/python-pytest-timeout.spec index fd678ed..3e519d1 100644 --- a/python-pytest-timeout.spec +++ b/python-pytest-timeout.spec @@ -6,12 +6,16 @@ know why the test suite hangs. Name: python-%{pypi_name} Version: 1.3.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: py.test plugin to abort hanging tests License: MIT URL: https://bitbucket.org/pytest-dev/pytest-timeout/ Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz + +# Support Pytest 4 +Patch1: %{url}commits/36998c891573d8ec1db1acd4f9438cb3cf2aee2e/raw#/pytest4.patch + BuildArch: noarch BuildRequires: python2-devel @@ -41,7 +45,7 @@ Requires: python3-pytest %{desc} %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -p1 -n %{pypi_name}-%{version} %build %py2_build @@ -68,6 +72,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 py.test-%{py %{python3_sitelib}/__pycache__/pytest_timeout* %changelog +* Thu Apr 04 2019 Miro HronĨok - 1.3.3-3 +- Add upstream patch for pytest 4 compatibility + * Sat Feb 02 2019 Fedora Release Engineering - 1.3.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild