Matej Cepl 2020-10-09 14:14:50 +00:00 committed by Git OBS Bridge
parent 475b148545
commit 4ca0cf5586
2 changed files with 27 additions and 18 deletions

View File

@ -3,9 +3,9 @@
tests/_device_tests/_attributes_tests.py | 1 +
tests/_device_tests/_device_tests.py | 1 +
tests/_device_tests/_devices_tests.py | 3 +++
tests/test_enumerate.py | 3 +++
tests/test_enumerate.py | 8 +++++---
tests/test_util.py | 2 ++
6 files changed, 14 insertions(+), 1 deletion(-)
6 files changed, 16 insertions(+), 4 deletions(-)
--- a/pytest.ini
+++ b/pytest.ini
@ -71,16 +71,6 @@
@pytest.mark.skipif(len(_BLOCK_DEVICES) == 0, reason='no block devices')
@given(strategies.sampled_from(_BLOCK_DEVICES))
@settings(max_examples=5)
--- a/tests/_device_tests/_device_tests.py
+++ b/tests/_device_tests/_device_tests.py
@@ -216,6 +216,7 @@ class TestDevice(object):
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):
--- a/tests/test_enumerate.py
+++ b/tests/test_enumerate.py
@@ -19,6 +19,7 @@ from __future__ import (print_function,
@ -91,6 +81,24 @@
from hypothesis import given
from hypothesis import settings
@@ -98,7 +99,7 @@ class TestEnumerator(object):
@failed_health_check_wrapper
@given(_CONTEXT_STRATEGY, _SUBSYSTEM_STRATEGY)
- @settings(max_examples=1)
+ @settings(max_examples=1, deadline=400)
def test_match_subsystem_nomatch(self, context, subsystem):
"""
Subsystem no match gets no subsystem with subsystem.
@@ -151,7 +152,7 @@ class TestEnumerator(object):
@failed_health_check_wrapper
@given(_CONTEXT_STRATEGY, _MATCH_PROPERTY_STRATEGY)
- @settings(max_examples=25)
+ @settings(max_examples=25, deadline=None)
def test_match_property_string(self, context, pair):
"""
Match property only gets devices with that property.
@@ -233,6 +234,7 @@ class TestEnumeratorMatchCombinations(ob
Test combinations of matches.
"""
@ -99,11 +107,12 @@
@given(_CONTEXT_STRATEGY,
strategies.lists(
elements=_MATCH_PROPERTY_STRATEGY,
@@ -260,6 +262,7 @@ class TestEnumeratorMatchCombinations(ob
)
)
@@ -262,7 +264,7 @@ class TestEnumeratorMatchCombinations(ob
+ @pytest.mark.real_udev
@given(_CONTEXT_STRATEGY, _SUBSYSTEM_STRATEGY, _SYSNAME_STRATEGY,
_MATCH_PROPERTY_STRATEGY)
@settings(max_examples=10)
- @settings(max_examples=10)
+ @settings(max_examples=10, deadline=None)
def test_match(self, context, subsystem, sysname, ppair):
"""
Test that matches from different categories are a conjunction.

View File

@ -33,8 +33,8 @@ BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: udev
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(udev)
Requires: libudev1
Requires: python-six
BuildArch: noarch