diff --git a/fix-tests-with-Python-3.10.patch b/fix-tests-with-Python-3.10.patch new file mode 100644 index 0000000..5ff0e87 --- /dev/null +++ b/fix-tests-with-Python-3.10.patch @@ -0,0 +1,41 @@ +From 2d150df7974a4a97ba3cbaec5a838f019882b527 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Wed, 5 May 2021 10:36:09 +0200 +Subject: [PATCH] Fix tests with Python 3.10 + +--- + tests/test_dunders.py | 3 +-- + tests/test_funcs.py | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/tests/test_dunders.py b/tests/test_dunders.py +index 2f1ebab..6afe860 100644 +--- a/tests/test_dunders.py ++++ b/tests/test_dunders.py +@@ -622,9 +622,8 @@ class TestAddInit(object): + with pytest.raises(TypeError) as e: + C(a=1, b=2) + +- assert ( ++ assert e.value.args[0].endswith( + "__init__() got an unexpected keyword argument 'a'" +- == e.value.args[0] + ) + + @given(booleans(), booleans()) +diff --git a/tests/test_funcs.py b/tests/test_funcs.py +index 20e2747..64e3eb7 100644 +--- a/tests/test_funcs.py ++++ b/tests/test_funcs.py +@@ -545,7 +545,7 @@ class TestEvolve(object): + with pytest.raises(TypeError) as e: + evolve(C(), aaaa=2) + expected = "__init__() got an unexpected keyword argument 'aaaa'" +- assert (expected,) == e.value.args ++ assert e.value.args[0].endswith(expected) + + def test_validator_failure(self): + """ +-- +2.31.1 + diff --git a/python-attrs.spec b/python-attrs.spec index 10728f1..fb0602b 100644 --- a/python-attrs.spec +++ b/python-attrs.spec @@ -10,7 +10,7 @@ Name: python-attrs Version: 20.3.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python attributes without boilerplate License: MIT @@ -18,6 +18,11 @@ URL: http://www.attrs.org/ BuildArch: noarch Source0: https://github.com/hynek/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz +# Partial backport of +# https://github.com/python-attrs/attrs/commit/03d3fc7a71fe770e1f86b9c3ad8588586e5ea63b +# to make tests pass. What happens next should be in +# https://github.com/python-attrs/attrs/issues/803 +Patch0: fix-tests-with-Python-3.10.patch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -44,6 +49,7 @@ object protocols. %prep %setup -q -n %{modname}-%{version} +%patch0 -p1 %build %py3_build @@ -62,6 +68,9 @@ PYTHONPATH=%{buildroot}/%{python3_sitelib} py.test-3 -v %{python3_sitelib}/* %changelog +* Wed May 05 2021 Lumír Balhar - 20.3.0-3 +- Fix tests with Python 3.10 + * Wed Jan 27 2021 Fedora Release Engineering - 20.3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild