!58 [sync] PR-56: fix test with latest pytest
From: @openeuler-sync-bot Reviewed-by: @zengwefeng Signed-off-by: @zengwefeng
This commit is contained in:
commit
6dcec58dfe
40
backport-Remove-pytest-deprecated_call.patch
Normal file
40
backport-Remove-pytest-deprecated_call.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
From b9084fab02c009a593b604562a69f36a5915c8e5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Denis Laxalde <denis@laxalde.org>
|
||||||
|
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 <hs@ox.cx>
|
||||||
|
---
|
||||||
|
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
|
||||||
@ -9,10 +9,11 @@ object protocols. \
|
|||||||
Name: python-attrs
|
Name: python-attrs
|
||||||
Summary: Python attributes without boilerplate
|
Summary: Python attributes without boilerplate
|
||||||
Version: 23.2.0
|
Version: 23.2.0
|
||||||
Release: 1
|
Release: 2
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://www.attrs.org/
|
URL: https://www.attrs.org/
|
||||||
Source0: https://github.com/hynek/attrs/archive/%{version}/attrs-%{version}.tar.gz
|
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}-setuptools
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
@ -60,6 +61,9 @@ PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} py.test-3 -v
|
|||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 28 2025 Funda Wang <fundawang@yeah.net> - 23.2.0-2
|
||||||
|
- fix test with latest pytest
|
||||||
|
|
||||||
* Mon Jan 29 2024 weihaohao <weihaohao2@huawei.com> - 23.2.0-1
|
* Mon Jan 29 2024 weihaohao <weihaohao2@huawei.com> - 23.2.0-1
|
||||||
- Update package to version 23.2.0
|
- Update package to version 23.2.0
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
version_control: github
|
version_control: github
|
||||||
src_repo: hynek/attrs
|
src_repo: python-attrs/attrs
|
||||||
tag_prefix: "^v"
|
tag_prefix:
|
||||||
seperator: "."
|
separator: "."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user