diff --git a/pytest8-compatibility.patch b/pytest8-compatibility.patch new file mode 100644 index 0000000..bd15fd2 --- /dev/null +++ b/pytest8-compatibility.patch @@ -0,0 +1,38 @@ +From 59b4b3e116c697abcd3868b28ec3a40d44dd3f77 Mon Sep 17 00:00:00 2001 +From: Denis Laxalde +Date: Wed, 28 Feb 2024 14:20:51 +0100 +Subject: [PATCH] Remove pytest.deprecated_call() in TestAssoc::test_unknown + +assoc() no longer raises a deprecation warning since commit +22ae8473fb88d6e585b05c709e81e1a46398a649 but the 'with +pytest.deprecated_call():' in that test was not removed then (in +contrast with other test cases). + +Maybe this got unnoticed due to a pytest bug? +In any case, using pytest 8+ (and keeping deprecated_call()) shows that +no warning is raised and the test fails. + +Removing the upper bound on pytest in dev dependencies as tests now +pass with pytest 8.0. + +Fix #1233. +--- + pyproject.toml | 3 +-- + tests/test_funcs.py | 4 +--- + 2 files changed, 2 insertions(+), 5 deletions(-) + +diff --git a/tests/test_funcs.py b/tests/test_funcs.py +index 044aaab2..398ba357 100644 +--- a/tests/test_funcs.py ++++ b/tests/test_funcs.py +@@ -600,9 +600,7 @@ def test_unknown(self, C): + AttrsAttributeNotFoundError. + """ + # No generated class will have a four letter attribute. +- with pytest.raises( +- AttrsAttributeNotFoundError +- ) as e, pytest.deprecated_call(): ++ with pytest.raises(AttrsAttributeNotFoundError) as e: + assoc(C(), aaaa=2) + + assert (f"aaaa is not an attrs attribute on {C!r}.",) == e.value.args diff --git a/python-attrs.spec b/python-attrs.spec index cf822b0..0737d92 100644 --- a/python-attrs.spec +++ b/python-attrs.spec @@ -22,6 +22,10 @@ Source0: https://github.com/python-attrs/%{modname}/archive/%{version}/%{ # Fix of tests for Python 3.13 Patch: https://github.com/python-attrs/attrs/commit/f9ff9135b4.patch +# Add compatibility with pytest 8 +# https://github.com/python-attrs/attrs/pull/1249.patch +Patch: pytest8-compatibility.patch + BuildRequires: python%{python3_pkgversion}-devel %description