From 7314f0533c623ff71b529677290a3a9e03aefb931cc10a4b4c3e87e88e2e9ad1 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 20 May 2024 01:34:47 +0000 Subject: [PATCH] Accepting request 1174816 from home:mcalabkova:branches:devel:languages:python:pytest - Add patch pytest8.patch to adapt the tests to the new pytest OBS-URL: https://build.opensuse.org/request/show/1174816 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-attrs?expand=0&rev=50 --- pytest8.patch | 41 +++++++++++++++++++++++++++++++++++++++++ python-attrs.changes | 5 +++++ python-attrs.spec | 4 +++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 pytest8.patch diff --git a/pytest8.patch b/pytest8.patch new file mode 100644 index 0000000..098161f --- /dev/null +++ b/pytest8.patch @@ -0,0 +1,41 @@ +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 +--- + pyproject.toml | 3 +-- + tests/test_funcs.py | 4 +--- + 2 files changed, 2 insertions(+), 5 deletions(-) + +Index: attrs-23.2.0/tests/test_funcs.py +=================================================================== +--- attrs-23.2.0.orig/tests/test_funcs.py ++++ attrs-23.2.0/tests/test_funcs.py +@@ -600,9 +600,7 @@ class TestAssoc: + 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.changes b/python-attrs.changes index 916a437..9e58a90 100644 --- a/python-attrs.changes +++ b/python-attrs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri May 17 09:51:39 UTC 2024 - Markéta Machová + +- Add patch pytest8.patch to adapt the tests to the new pytest + ------------------------------------------------------------------- Mon Jan 8 08:59:59 UTC 2024 - Dirk Müller diff --git a/python-attrs.spec b/python-attrs.spec index 597047a..f5f0478 100644 --- a/python-attrs.spec +++ b/python-attrs.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-attrs # # Copyright (c) 2024 SUSE LLC # @@ -33,6 +33,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/hynek/attrs/ Source: https://files.pythonhosted.org/packages/source/a/attrs/attrs-%{version}.tar.gz +#PATCH-FIX-UPSTREAM https://github.com/python-attrs/attrs/pull/1249 Remove pytest.deprecated_call() in TestAssoc::test_unknown +Patch: pytest8.patch BuildRequires: %{python_module hatch-fancy-pypi-readme} BuildRequires: %{python_module hatch-vcs} BuildRequires: %{python_module hatchling}