Add patch to support pytest 2.7 in EPEL7

This commit is contained in:
Orion Poplawski 2017-01-31 15:30:07 -07:00
parent 6cade84fbf
commit 9e9418770c
2 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1,19 @@
diff -up ruamel-yaml-171c3653fc01/_test/test_anchor.py.pytest27 ruamel-yaml-171c3653fc01/_test/test_anchor.py
--- ruamel-yaml-171c3653fc01/_test/test_anchor.py.pytest27 2016-09-21 02:09:18.000000000 -0600
+++ ruamel-yaml-171c3653fc01/_test/test_anchor.py 2017-01-31 15:25:09.245847125 -0700
@@ -5,6 +5,7 @@ testing of anchors and the aliases refer
"""
import pytest
+from distutils.version import LooseVersion
from textwrap import dedent
import platform
@@ -231,6 +232,7 @@ class TestAnchorsAliases:
""")
# this is an error in PyYAML
+ @pytest.mark.skipif(LooseVersion(pytest.__version__) < LooseVersion("2.8"), reason="Need pytest 2.7")
def test_reused_anchor(self):
yaml = '''
- &a

View File

@ -6,7 +6,7 @@
Name: python-%{pname} Name: python-%{pname}
Version: 0.12.14 Version: 0.12.14
Release: 6%{?dist} Release: 7%{?dist}
Summary: YAML 1.2 loader/dumper package for Python Summary: YAML 1.2 loader/dumper package for Python
License: MIT License: MIT
@ -14,6 +14,8 @@ URL: https://bitbucket.org/ruamel/yaml
#Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz #Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
# Use bitbucket sources so we can run the tests # Use bitbucket sources so we can run the tests
Source0: https://bitbucket.org/ruamel/yaml/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz Source0: https://bitbucket.org/ruamel/yaml/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz
# Works with pytest 2.7
Patch0: python-ruamel-yaml-pytest27.patch
BuildRequires: libyaml-devel BuildRequires: libyaml-devel
@ -63,7 +65,7 @@ It is a derivative of Kirill Simonovs PyYAML 3.11
%endif %endif
%prep %prep
%autosetup -n %{pname}-%{commit} %autosetup -n %{pname}-%{commit} -p1
rm -rf %{pypi_name}.egg-info rm -rf %{pypi_name}.egg-info
%build %build
@ -80,9 +82,7 @@ rm -rf %{pypi_name}.egg-info
%{__python2} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT %{__python2} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT
%check %check
# Fails with "AttributeError: 'module' object has no attribute 'warns'" due to PYTHONPATH=$(echo build/lib.*%{python2_version}) py.test-%{python2_version} _test/test_*.py
# old pytest on EL7.
PYTHONPATH=$(echo build/lib.*%{python2_version}) py.test-%{python2_version} _test/test_*.py %{?el7:|| :}
%if 0%{?with_python3} %if 0%{?with_python3}
PYTHONPATH=$(echo build/lib.*%{python3_version}) py.test-%{python3_version} _test/test_*.py PYTHONPATH=$(echo build/lib.*%{python3_version}) py.test-%{python3_version} _test/test_*.py
%endif %endif
@ -106,6 +106,9 @@ PYTHONPATH=$(echo build/lib.*%{python3_version}) py.test-%{python3_version} _tes
%endif %endif
%changelog %changelog
* Tue Jan 31 2017 Orion Poplawski <orion@cora.nwra.com> - 0.12.14-7
- Add patch to support pytest 2.7 in EPEL7
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.12.14-6 * Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.12.14-6
- Rebuild for Python 3.6 - Rebuild for Python 3.6