2022-03-10 23:07:17 +00:00
|
|
|
diff --git a/pytest.ini b/pytest.ini
|
|
|
|
index 9d9100b..9c60249 100644
|
2020-10-08 23:03:46 +00:00
|
|
|
--- a/pytest.ini
|
|
|
|
+++ b/pytest.ini
|
2020-10-09 11:43:31 +00:00
|
|
|
@@ -1,3 +1,6 @@
|
2020-10-08 23:03:46 +00:00
|
|
|
-[tool:pytest]
|
|
|
|
+[pytest]
|
|
|
|
# do not search for tests in build directory
|
|
|
|
norecursedirs = .* _* build
|
|
|
|
+markers =
|
|
|
|
+ conversion
|
2020-10-09 11:43:31 +00:00
|
|
|
+ real_udev
|
2022-03-10 23:07:17 +00:00
|
|
|
diff --git a/tests/_device_tests/_attributes_tests.py b/tests/_device_tests/_attributes_tests.py
|
|
|
|
index 4e42cda..0ad1384 100644
|
2020-10-09 11:43:31 +00:00
|
|
|
--- a/tests/_device_tests/_attributes_tests.py
|
|
|
|
+++ b/tests/_device_tests/_attributes_tests.py
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -122,6 +122,7 @@ def test_asbool(self, a_context, device_datum):
|
2020-10-09 11:43:31 +00:00
|
|
|
with pytest.raises(ValueError):
|
|
|
|
device.attributes.asbool(key)
|
|
|
|
|
|
|
|
+ @pytest.mark.real_udev
|
|
|
|
@_UDEV_TEST(167, "test_available_attributes")
|
|
|
|
@given(strategies.sampled_from(_DEVICES))
|
|
|
|
@settings(max_examples=5)
|
2022-03-10 23:07:17 +00:00
|
|
|
diff --git a/tests/_device_tests/_device_tests.py b/tests/_device_tests/_device_tests.py
|
|
|
|
index 30230f8..1b9a1af 100644
|
2022-01-17 06:03:59 +00:00
|
|
|
--- a/tests/_device_tests/_device_tests.py
|
|
|
|
+++ b/tests/_device_tests/_device_tests.py
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -215,6 +215,7 @@ def test_device_node(self, a_context, device_datum):
|
2022-01-17 06:03:59 +00:00
|
|
|
if device.device_node:
|
|
|
|
assert is_unicode_string(device.device_node)
|
|
|
|
|
|
|
|
+ @pytest.mark.real_udev
|
|
|
|
@given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
|
|
|
|
@settings(max_examples=5)
|
|
|
|
def test_device_number(self, a_context, device_datum):
|
2022-03-10 23:07:17 +00:00
|
|
|
diff --git a/tests/_device_tests/_devices_tests.py b/tests/_device_tests/_devices_tests.py
|
|
|
|
index 2cb4825..01e5a8a 100644
|
2020-10-09 11:43:31 +00:00
|
|
|
--- a/tests/_device_tests/_devices_tests.py
|
|
|
|
+++ b/tests/_device_tests/_devices_tests.py
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -128,6 +128,7 @@ def test_from_name_nonexisting_subsystem(self):
|
2022-01-17 06:03:59 +00:00
|
|
|
assert error.subsystem == "no_such_subsystem"
|
|
|
|
assert error.sys_name == "foobar"
|
2020-10-09 11:43:31 +00:00
|
|
|
|
|
|
|
+ @pytest.mark.real_udev
|
|
|
|
@failed_health_check_wrapper
|
|
|
|
@given(
|
|
|
|
_CONTEXT_STRATEGY,
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -143,6 +144,7 @@ def test_from_device_number(self, a_context, a_device):
|
2022-01-17 06:03:59 +00:00
|
|
|
device = Devices.from_device_number(a_context, typ, a_device.device_number)
|
2020-10-09 11:43:31 +00:00
|
|
|
assert a_device == device
|
|
|
|
|
|
|
|
+ @pytest.mark.real_udev
|
|
|
|
@failed_health_check_wrapper
|
|
|
|
@given(
|
|
|
|
_CONTEXT_STRATEGY,
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -178,6 +180,7 @@ def test_from_device_number_invalid_type(self):
|
2020-10-09 11:43:31 +00:00
|
|
|
with pytest.raises(DeviceNotFoundByNumberError):
|
2022-01-17 06:03:59 +00:00
|
|
|
Devices.from_device_number(_CONTEXT, "foobar", 100)
|
2020-10-09 11:43:31 +00:00
|
|
|
|
|
|
|
+ @pytest.mark.real_udev
|
|
|
|
@failed_health_check_wrapper
|
|
|
|
@given(
|
|
|
|
_CONTEXT_STRATEGY,
|
2022-03-10 23:07:17 +00:00
|
|
|
diff --git a/tests/test_enumerate.py b/tests/test_enumerate.py
|
|
|
|
index 8efb1f8..83af62d 100644
|
2022-01-17 06:03:59 +00:00
|
|
|
--- a/tests/test_enumerate.py
|
|
|
|
+++ b/tests/test_enumerate.py
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -104,7 +104,7 @@ def test_match_subsystem(self, context, subsystem):
|
2022-01-17 06:03:59 +00:00
|
|
|
|
|
|
|
@failed_health_check_wrapper
|
|
|
|
@given(_CONTEXT_STRATEGY, _SUBSYSTEM_STRATEGY)
|
2022-03-10 23:07:17 +00:00
|
|
|
- @settings(max_examples=5)
|
|
|
|
+ @settings(max_examples=5, deadline=None)
|
|
|
|
def test_match_subsystem_nomatch_unfulfillable(self, context, subsystem):
|
2022-01-17 06:03:59 +00:00
|
|
|
"""
|
2022-03-10 23:07:17 +00:00
|
|
|
Combining match and no match should give an empty result.
|
|
|
|
diff --git a/tests/test_util.py b/tests/test_util.py
|
|
|
|
index 1389b6b..4b8587d 100644
|
2020-10-09 11:43:31 +00:00
|
|
|
--- a/tests/test_util.py
|
|
|
|
+++ b/tests/test_util.py
|
2022-01-17 06:03:59 +00:00
|
|
|
@@ -132,6 +132,7 @@ def raise_valueerror():
|
2020-10-09 11:43:31 +00:00
|
|
|
_CHAR_DEVICES = list(_CONTEXT.list_devices(subsystem="tty"))
|
|
|
|
|
|
|
|
|
|
|
|
+@pytest.mark.real_udev
|
2022-01-17 06:03:59 +00:00
|
|
|
@pytest.mark.skipif(len(_CHAR_DEVICES) == 0, reason="no tty devices")
|
2020-10-09 11:43:31 +00:00
|
|
|
@given(strategies.sampled_from(_CHAR_DEVICES))
|
|
|
|
@settings(max_examples=5)
|
2022-03-10 23:07:17 +00:00
|
|
|
@@ -145,6 +146,7 @@ def test_get_device_type_character_device(a_device):
|
2020-10-09 11:43:31 +00:00
|
|
|
_BLOCK_DEVICES = list(_CONTEXT.list_devices(subsystem="block"))
|
|
|
|
|
|
|
|
|
|
|
|
+@pytest.mark.real_udev
|
2022-01-17 06:03:59 +00:00
|
|
|
@pytest.mark.skipif(len(_BLOCK_DEVICES) == 0, reason="no block devices")
|
2020-10-09 11:43:31 +00:00
|
|
|
@given(strategies.sampled_from(_BLOCK_DEVICES))
|
|
|
|
@settings(max_examples=5)
|