From 7062fb77a916db3e7c7b79c0b8d4a1c43bfedbce Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 28 Jan 2025 14:23:48 +0800 Subject: [PATCH] fix test with latest pytest (cherry picked from commit dc788c8554ddce915a49aa2233c8efa4dbccfaab) --- backport-Remove-pytest-deprecated_call.patch | 40 ++++++++++++++++++++ python-attrs.spec | 10 +++-- python-attrs.yaml | 6 +-- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 backport-Remove-pytest-deprecated_call.patch diff --git a/backport-Remove-pytest-deprecated_call.patch b/backport-Remove-pytest-deprecated_call.patch new file mode 100644 index 0000000..5ce8e7d --- /dev/null +++ b/backport-Remove-pytest-deprecated_call.patch @@ -0,0 +1,40 @@ +From b9084fab02c009a593b604562a69f36a5915c8e5 Mon Sep 17 00:00:00 2001 +From: Denis Laxalde +Date: Sat, 2 Mar 2024 07:40:36 +0100 +Subject: [PATCH] Remove pytest.deprecated_call() in TestAssoc::test_unknown + (#1249) + +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. + +Co-authored-by: Hynek Schlawack +--- + tests/test_funcs.py | 4 +--- + 1 files changed, 1 insertion, 3 deletions(-) + +diff --git a/tests/test_funcs.py b/tests/test_funcs.py +index 044aaab2c..398ba3576 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 b835191..1c23ae7 100644 --- a/python-attrs.spec +++ b/python-attrs.spec @@ -9,10 +9,11 @@ object protocols. \ Name: python-attrs Summary: Python attributes without boilerplate Version: 23.2.0 -Release: 1 +Release: 2 License: MIT -URL: http://www.attrs.org/ -Source0: https://github.com/hynek/attrs/archive/%{version}/attrs-%{version}.tar.gz +URL: https://www.attrs.org/ +Source0: https://github.com/python-attrs/attrs/archive/%{version}/attrs-%{version}.tar.gz +Patch6001: backport-Remove-pytest-deprecated_call.patch BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-devel @@ -60,6 +61,9 @@ PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} py.test-3 -v %doc README.md %changelog +* Tue Jan 28 2025 Funda Wang - 23.2.0-2 +- fix test with latest pytest + * Mon Jan 29 2024 weihaohao - 23.2.0-1 - Update package to version 23.2.0 diff --git a/python-attrs.yaml b/python-attrs.yaml index e362213..5f054e9 100644 --- a/python-attrs.yaml +++ b/python-attrs.yaml @@ -1,4 +1,4 @@ version_control: github -src_repo: hynek/attrs -tag_prefix: "^v" -seperator: "." +src_repo: python-attrs/attrs +tag_prefix: +separator: "." -- Gitee