Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyudev/, dev-python/pyudev/files/
Date: Sat, 01 Jan 2022 09:23:32
Message-Id: 1641028998.7595b65a2fe159d2deab6b7d274638dcbc7a61c2.arthurzam@gentoo
1 commit: 7595b65a2fe159d2deab6b7d274638dcbc7a61c2
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 1 09:22:40 2022 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 1 09:23:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7595b65a
7
8 dev-python/pyudev: disable hypothesis timeouts
9
10 Closes: https://bugs.gentoo.org/829862
11 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
12
13 .../pyudev/files/pyudev-0.22-fix-hypothesis.patch | 98 ----------------------
14 dev-python/pyudev/pyudev-0.22.0-r1.ebuild | 9 +-
15 2 files changed, 4 insertions(+), 103 deletions(-)
16
17 diff --git a/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch b/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch
18 deleted file mode 100644
19 index 5a6b27324d82..000000000000
20 --- a/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch
21 +++ /dev/null
22 @@ -1,98 +0,0 @@
23 -diff --git a/tests/_device_tests/_attributes_tests.py b/tests/_device_tests/_attributes_tests.py
24 -index 23fa6da..7baf043 100644
25 ---- a/tests/_device_tests/_attributes_tests.py
26 -+++ b/tests/_device_tests/_attributes_tests.py
27 -@@ -50,7 +50,7 @@ class TestAttributes(object):
28 - """
29 -
30 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
31 -- @settings(max_examples=5)
32 -+ @settings(max_examples=5, deadline=30000)
33 - def test_getitem(self, a_context, device_datum):
34 - """
35 - Test that attribute value exists and is instance of bytes.
36 -@@ -60,7 +60,7 @@ def test_getitem(self, a_context, device_datum):
37 - for key in device_datum.attributes.keys())
38 -
39 - @given(strategies.sampled_from(_DEVICES))
40 -- @settings(max_examples=5)
41 -+ @settings(max_examples=5, deadline=30000)
42 - def test_getitem_nonexisting(self, a_device):
43 - """
44 - Test behavior when corresponding value is non-existant.
45 -@@ -87,7 +87,7 @@ def test_non_iterable(self, a_device):
46 - a_device.attributes['key']
47 -
48 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
49 -- @settings(max_examples=5)
50 -+ @settings(max_examples=5, deadline=30000)
51 - def test_asstring(self, a_context, device_datum):
52 - """
53 - Test that attribute exists for actual device and is unicode.
54 -@@ -97,7 +97,7 @@ def test_asstring(self, a_context, device_datum):
55 - for key in device_datum.attributes.keys())
56 -
57 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
58 -- @settings(max_examples=10)
59 -+ @settings(max_examples=10, deadline=30000)
60 - def test_asint(self, a_context, device_datum):
61 - """
62 - Test that integer result is an int or ValueError raised.
63 -@@ -111,7 +111,7 @@ def test_asint(self, a_context, device_datum):
64 - device.attributes.asint(key)
65 -
66 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
67 -- @settings(max_examples=5)
68 -+ @settings(max_examples=5, deadline=30000)
69 - def test_asbool(self, a_context, device_datum):
70 - """
71 - Test that bool result is a bool or ValueError raised.
72 -diff --git a/tests/_device_tests/_device_tests.py b/tests/_device_tests/_device_tests.py
73 -index b9a84c6..2ce6751 100644
74 ---- a/tests/_device_tests/_device_tests.py
75 -+++ b/tests/_device_tests/_device_tests.py
76 -@@ -352,7 +352,7 @@ def test_key_subset(self, a_context, device_datum):
77 - frozenset(device.properties.keys())
78 -
79 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
80 -- @settings(max_examples=1)
81 -+ @settings(max_examples=1, deadline=30000)
82 - def test_getitem(self, a_context, device_datum):
83 - device = Devices.from_path(a_context, device_datum.device_path)
84 - for prop in device_datum.properties:
85 -@@ -372,7 +372,7 @@ def test_getitem(self, a_context, device_datum):
86 - @pytest.mark.skipif(
87 - len(_device_data) == 0, reason='no device with a DEVNAME property')
88 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_device_data))
89 -- @settings(max_examples=5)
90 -+ @settings(max_examples=5, deadline=30000)
91 - def test_getitem_devname(self, a_context, device_datum):
92 - device = Devices.from_path(a_context, device_datum.device_path)
93 - data_devname = os.path.join(a_context.device_path,
94 -@@ -382,7 +382,7 @@ def test_getitem_devname(self, a_context, device_datum):
95 - assert device_devname == data_devname
96 -
97 - @given(strategies.sampled_from(_DEVICES))
98 -- @settings(max_examples=5)
99 -+ @settings(max_examples=5, deadline=30000)
100 - def test_getitem_nonexisting(self, a_device):
101 - with pytest.raises(KeyError) as excinfo:
102 - # pylint: disable=pointless-statement
103 -@@ -390,7 +390,7 @@ def test_getitem_nonexisting(self, a_device):
104 - assert str(excinfo.value) == repr('a non-existing property')
105 -
106 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
107 -- @settings(max_examples=5)
108 -+ @settings(max_examples=5, deadline=30000)
109 - def test_asint(self, a_context, device_datum):
110 - device = Devices.from_path(a_context, device_datum.device_path)
111 - for prop, value in device_datum.properties.items():
112 -@@ -403,7 +403,7 @@ def test_asint(self, a_context, device_datum):
113 - assert device.properties.asint(prop) == value
114 -
115 - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
116 -- @settings(max_examples=5)
117 -+ @settings(max_examples=5, deadline=30000)
118 - def test_asbool(self, a_context, device_datum):
119 - """
120 - Test that values of 1 and 0 get properly interpreted as bool
121
122 diff --git a/dev-python/pyudev/pyudev-0.22.0-r1.ebuild b/dev-python/pyudev/pyudev-0.22.0-r1.ebuild
123 index 622a38c9c9c9..b17a7837de83 100644
124 --- a/dev-python/pyudev/pyudev-0.22.0-r1.ebuild
125 +++ b/dev-python/pyudev/pyudev-0.22.0-r1.ebuild
126 @@ -1,4 +1,4 @@
127 -# Copyright 1999-2021 Gentoo Authors
128 +# Copyright 1999-2022 Gentoo Authors
129 # Distributed under the terms of the GNU General Public License v2
130
131 EAPI=7
132 @@ -30,10 +30,6 @@ DEPEND="${RDEPEND}
133
134 DOCS=( CHANGES.rst README.rst )
135
136 -PATCHES=(
137 - "${FILESDIR}/pyudev-0.22-fix-hypothesis.patch"
138 -)
139 -
140 distutils_enable_tests pytest
141
142 python_prepare_all() {
143 @@ -47,5 +43,8 @@ python_prepare_all() {
144 sed -i -e "s|== \('/run/udev'\)|in (\1,'/dev/.udev')|g" \
145 tests/test_core.py || die
146
147 + # disable use hypothesis timeouts (too short)
148 + sed -e '/@settings/s/(/(deadline=None,/' -i tests{,/_device_tests}/*.py || die
149 +
150 distutils-r1_python_prepare_all
151 }