14
0

- add pytest-catch-warnings.patch to fix build with newer

pytest/python 3.13

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hid-parser?expand=0&rev=4
This commit is contained in:
2024-11-20 10:23:34 +00:00
committed by Git OBS Bridge
parent a9d83cd70c
commit 66b2484471
3 changed files with 62 additions and 4 deletions

View File

@@ -0,0 +1,51 @@
--- hid-parser-0.0.3/tests/test_items.py
+++ hid-parser-0.0.3/tests/test_items.py
@@ -5,7 +5,7 @@
import pytest
import hid_parser
-
+import warnings
def test_baseitem():
item = hid_parser.BaseItem(1, 2)
@@ -129,14 +129,18 @@
with pytest.warns(hid_parser.HIDComplianceWarning):
hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0001, 0x0001), -1, 1)
- with pytest.warns(None):
+ with warnings.catch_warnings():
hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0001, 0x0030), -1, 1)
+ warnings.simplefilter("error")
- with pytest.warns(None):
+ with warnings.catch_warnings():
hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0001, 0x0000), -1, 1)
+ warnings.simplefilter("error")
- with pytest.warns(None):
+ with warnings.catch_warnings():
hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0000, 0x0000), -1, 1)
+ warnings.simplefilter("error")
+
def test_arrayitem():
@@ -179,11 +183,14 @@
with pytest.warns(hid_parser.HIDComplianceWarning):
hid_parser.ArrayItem(1, 2, 0, usages, -1, 1)
- with pytest.warns(None):
+ with warnings.catch_warnings():
hid_parser.ArrayItem(1, 2, 0, usages, -1, 1)
+ warnings.simplefilter("error")
- with pytest.warns(None):
+ with warnings.catch_warnings():
hid_parser.ArrayItem(1, 2, 0, usages, -1, 1)
+ warnings.simplefilter("error")
- with pytest.warns(None):
+ with warnings.catch_warnings():
hid_parser.ArrayItem(1, 2, 0, usages, -1, 1)
+ warnings.simplefilter("error")

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Nov 20 10:23:16 UTC 2024 - Dirk Müller <dmueller@suse.com>
- add pytest-catch-warnings.patch to fix build with newer
pytest/python 3.13
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 7 15:12:36 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org> Mon Nov 7 15:12:36 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@@ -1,7 +1,7 @@
# #
# spec file # spec file for package python-hid-parser
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,8 @@ Release: 0
Summary: Parse HID report descriptors Summary: Parse HID report descriptors
License: MIT License: MIT
URL: https://github.com/FFY00/python-hid-parser URL: https://github.com/FFY00/python-hid-parser
Source0: https://files.pythonhosted.org/packages/48/af/6266119b18570fee7dc838c3389e37db3586a4e2003de709cf4ac24e395a/hid-parser-0.0.3.tar.gz Source0: https://files.pythonhosted.org/packages/source/h/hid-parser/hid-parser-%{version}.tar.gz
Patch1: pytest-catch-warnings.patch
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
@@ -42,7 +43,7 @@ Conflicts: solaar < 1.1.7
Typed pure Python library to parse HID report descriptors Typed pure Python library to parse HID report descriptors
%prep %prep
%setup -q -n %{pkg_name}-%{version} %autosetup -p1 -n %{pkg_name}-%{version}
%build %build
%pyproject_wheel %pyproject_wheel