forked from pool/python-hid-parser
pytest/python 3.13 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hid-parser?expand=0&rev=4
52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
--- 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")
|