Fix testcase test_anchor and test_deprecation error
Signed-off-by: cherry530 <xuping33@huawei.com>
This commit is contained in:
parent
366b20494d
commit
9379d2ef55
@ -0,0 +1,14 @@
|
|||||||
|
diff --git a/_test/test_deprecation.py b/_test/test_deprecation.py
|
||||||
|
index 35cb095..14acd71 100644
|
||||||
|
--- a/_test/test_deprecation.py
|
||||||
|
+++ b/_test/test_deprecation.py
|
||||||
|
@@ -6,7 +6,8 @@ import sys
|
||||||
|
import pytest # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
-@pytest.mark.skipif(sys.version_info < (3, 7), reason='collections not available?')
|
||||||
|
+@pytest.mark.skipif(sys.version_info < (3, 7) or sys.version_info >= (3, 9),
|
||||||
|
+ reason='collections not available?')
|
||||||
|
def test_collections_deprecation():
|
||||||
|
with pytest.warns(DeprecationWarning):
|
||||||
|
from collections import Hashable # NOQA
|
||||||
@ -1,18 +0,0 @@
|
|||||||
diff -u ruamel-yaml-ff02b83b8f91/_test/test_anchor.py.pytest27 ruamel-yaml-ff02b83b8f91/_test/test_anchor.py
|
|
||||||
--- ruamel-yaml-ff02b83b8f91/_test/test_anchor.py.pytest27 2019-08-27 10:59:01.756747586 +0100
|
|
||||||
+++ ruamel-yaml-ff02b83b8f91/_test/test_anchor.py 2019-08-27 11:00:15.929713043 +0100
|
|
||||||
@@ -7,6 +7,7 @@
|
|
||||||
"""
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
+from distutils.version import LooseVersion
|
|
||||||
from textwrap import dedent
|
|
||||||
import platform
|
|
||||||
|
|
||||||
@@ -248,6 +249,7 @@
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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):
|
|
||||||
from ruamel.yaml.error import ReusedAnchorWarning
|
|
||||||
@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
Name: python-%{pname}
|
Name: python-%{pname}
|
||||||
Version: 0.16.5
|
Version: 0.16.5
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: YAML 1.2 loader/dumper package for Python
|
Summary: YAML 1.2 loader/dumper package for Python
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://bitbucket.org/ruamel/yaml
|
URL: https://bitbucket.org/ruamel/yaml
|
||||||
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
|
||||||
|
|
||||||
Patch0001: python-ruamel-yaml-pytest27.patch
|
Patch0001: python-ruamel-yaml-pathlib.patch
|
||||||
Patch0002: python-ruamel-yaml-pathlib.patch
|
Patch0002: Fix-testcase-error-due-to-distutils-package-is-deprecated.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||||
@ -47,13 +47,16 @@ PYTHONPATH=$(echo build/lib) py.test-%{python3_version} _test/test_*.py
|
|||||||
%files -n python3-%{pname}
|
%files -n python3-%{pname}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python3_sitelib}/ruamel
|
%{python3_sitelib}/ruamel
|
||||||
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?-*.pth
|
%{python3_sitelib}/%{pypi_name}-%{version}-py*.pth
|
||||||
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
%{python3_sitelib}/%{pypi_name}-%{version}-py*.egg-info
|
||||||
|
|
||||||
%files help
|
%files help
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
*Tue Mar 29 2022 xu_ping <xuping33@huawei.com> - 0.16.5-2
|
||||||
|
- Fix testcase test_anchor and test_deprecation error
|
||||||
|
|
||||||
* Mon Mar 2 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.16.5-1
|
* Mon Mar 2 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.16.5-1
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user