diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-01-01 11:22:40 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-01-01 11:23:18 +0200 |
commit | 7595b65a2fe159d2deab6b7d274638dcbc7a61c2 (patch) | |
tree | 384345aa0c6ede97c7c1022d1a16af56bc5d73f8 /dev-python/pyudev | |
parent | sys-apps/toybox: Bump to 0.8.6 (diff) | |
download | gentoo-7595b65a2fe159d2deab6b7d274638dcbc7a61c2.tar.gz gentoo-7595b65a2fe159d2deab6b7d274638dcbc7a61c2.tar.bz2 gentoo-7595b65a2fe159d2deab6b7d274638dcbc7a61c2.zip |
dev-python/pyudev: disable hypothesis timeouts
Closes: https://bugs.gentoo.org/829862
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/pyudev')
-rw-r--r-- | dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch | 98 | ||||
-rw-r--r-- | dev-python/pyudev/pyudev-0.22.0-r1.ebuild | 9 |
2 files changed, 4 insertions, 103 deletions
diff --git a/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch b/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch deleted file mode 100644 index 5a6b27324d82..000000000000 --- a/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/tests/_device_tests/_attributes_tests.py b/tests/_device_tests/_attributes_tests.py -index 23fa6da..7baf043 100644 ---- a/tests/_device_tests/_attributes_tests.py -+++ b/tests/_device_tests/_attributes_tests.py -@@ -50,7 +50,7 @@ class TestAttributes(object): - """ - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_getitem(self, a_context, device_datum): - """ - Test that attribute value exists and is instance of bytes. -@@ -60,7 +60,7 @@ def test_getitem(self, a_context, device_datum): - for key in device_datum.attributes.keys()) - - @given(strategies.sampled_from(_DEVICES)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_getitem_nonexisting(self, a_device): - """ - Test behavior when corresponding value is non-existant. -@@ -87,7 +87,7 @@ def test_non_iterable(self, a_device): - a_device.attributes['key'] - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_asstring(self, a_context, device_datum): - """ - Test that attribute exists for actual device and is unicode. -@@ -97,7 +97,7 @@ def test_asstring(self, a_context, device_datum): - for key in device_datum.attributes.keys()) - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=10) -+ @settings(max_examples=10, deadline=30000) - def test_asint(self, a_context, device_datum): - """ - Test that integer result is an int or ValueError raised. -@@ -111,7 +111,7 @@ def test_asint(self, a_context, device_datum): - device.attributes.asint(key) - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_asbool(self, a_context, device_datum): - """ - Test that bool result is a bool or ValueError raised. -diff --git a/tests/_device_tests/_device_tests.py b/tests/_device_tests/_device_tests.py -index b9a84c6..2ce6751 100644 ---- a/tests/_device_tests/_device_tests.py -+++ b/tests/_device_tests/_device_tests.py -@@ -352,7 +352,7 @@ def test_key_subset(self, a_context, device_datum): - frozenset(device.properties.keys()) - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=1) -+ @settings(max_examples=1, deadline=30000) - def test_getitem(self, a_context, device_datum): - device = Devices.from_path(a_context, device_datum.device_path) - for prop in device_datum.properties: -@@ -372,7 +372,7 @@ def test_getitem(self, a_context, device_datum): - @pytest.mark.skipif( - len(_device_data) == 0, reason='no device with a DEVNAME property') - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_device_data)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_getitem_devname(self, a_context, device_datum): - device = Devices.from_path(a_context, device_datum.device_path) - data_devname = os.path.join(a_context.device_path, -@@ -382,7 +382,7 @@ def test_getitem_devname(self, a_context, device_datum): - assert device_devname == data_devname - - @given(strategies.sampled_from(_DEVICES)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_getitem_nonexisting(self, a_device): - with pytest.raises(KeyError) as excinfo: - # pylint: disable=pointless-statement -@@ -390,7 +390,7 @@ def test_getitem_nonexisting(self, a_device): - assert str(excinfo.value) == repr('a non-existing property') - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_asint(self, a_context, device_datum): - device = Devices.from_path(a_context, device_datum.device_path) - for prop, value in device_datum.properties.items(): -@@ -403,7 +403,7 @@ def test_asint(self, a_context, device_datum): - assert device.properties.asint(prop) == value - - @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) -- @settings(max_examples=5) -+ @settings(max_examples=5, deadline=30000) - def test_asbool(self, a_context, device_datum): - """ - Test that values of 1 and 0 get properly interpreted as bool diff --git a/dev-python/pyudev/pyudev-0.22.0-r1.ebuild b/dev-python/pyudev/pyudev-0.22.0-r1.ebuild index 622a38c9c9c9..b17a7837de83 100644 --- a/dev-python/pyudev/pyudev-0.22.0-r1.ebuild +++ b/dev-python/pyudev/pyudev-0.22.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -30,10 +30,6 @@ DEPEND="${RDEPEND} DOCS=( CHANGES.rst README.rst ) -PATCHES=( - "${FILESDIR}/pyudev-0.22-fix-hypothesis.patch" -) - distutils_enable_tests pytest python_prepare_all() { @@ -47,5 +43,8 @@ python_prepare_all() { sed -i -e "s|== \('/run/udev'\)|in (\1,'/dev/.udev')|g" \ tests/test_core.py || die + # disable use hypothesis timeouts (too short) + sed -e '/@settings/s/(/(deadline=None,/' -i tests{,/_device_tests}/*.py || die + distutils-r1_python_prepare_all } |