From c696808012ba1f78d4439ddd0252311bf7b922aa Mon Sep 17 00:00:00 2001 From: Carl George Date: May 03 2019 17:35:38 +0000 Subject: Add patch for pytest 4 compatibility --- diff --git a/pytest-compat.patch b/pytest-compat.patch new file mode 100644 index 0000000..077cc41 --- /dev/null +++ b/pytest-compat.patch @@ -0,0 +1,17 @@ +diff -Nurp pdir2-0.3.1.orig/tests/test_z_config.py pdir2-0.3.1/tests/test_z_config.py +--- pdir2-0.3.1.orig/tests/test_z_config.py 2019-05-03 10:05:53.938505609 -0500 ++++ pdir2-0.3.1/tests/test_z_config.py 2019-05-03 10:39:12.477518275 -0500 +@@ -15,10 +15,10 @@ from sys import modules + import pytest + from pdir.color import COLORS + +-if pytest.__version__[0] == '2': +- from pytest import yield_fixture as fixture +-elif pytest.__version__[0] == '3': ++if int(pytest.__version__.split('.')[0]) >= 3: + from pytest import fixture as fixture ++else: ++ from pytest import yield_fixture as fixture + + + @fixture diff --git a/python-pdir2.spec b/python-pdir2.spec index 2aacdf9..9aef0de 100644 --- a/python-pdir2.spec +++ b/python-pdir2.spec @@ -37,6 +37,12 @@ URL: https://github.com/laike9m/pdir2 Source0: %{url}/archive/v%{tag}/%{srcname}-%{version}.tar.gz # https://github.com/laike9m/pdir2/issues/31 Patch0: remove-environment-markers.patch +# The latest upstream release doesn't work with pytest 4. It's fixed in +# master, but the upstream fix also drops support for pytest 2, which is the +# version we have in EL7. This downstream only patch combines pytest 2 and 4 +# support so we can work on EPEL7 through Rawhide. +# https://github.com/laike9m/pdir2/commit/787195841c86980562c81fc81df65d4096a73f09#diff-e2b79530c0a804d26dfec15c6f85f757 +Patch1: pytest-compat.patch BuildArch: noarch @@ -120,6 +126,7 @@ BuildRequires: python%{python3_pkgversion}-pandas - Drop python3_other subpackage - Disable python2 subpackage on EL8 - Run python2 tests on EL7 +- Add patch for pytest 4 compatibility rhbz#1706163 * Sat Feb 02 2019 Fedora Release Engineering - 0.3.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild