dev-python/priority: Enable py3.8, fix tests
authorMichał Górny <mgorny@gentoo.org>
Fri, 22 Nov 2019 08:07:08 +0000 (09:07 +0100)
committerMichał Górny <mgorny@gentoo.org>
Fri, 22 Nov 2019 08:40:44 +0000 (09:40 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/priority/files/priority-1.3.0-test-timeout.patch [new file with mode: 0644]
dev-python/priority/priority-1.3.0.ebuild

diff --git a/dev-python/priority/files/priority-1.3.0-test-timeout.patch b/dev-python/priority/files/priority-1.3.0-test-timeout.patch
new file mode 100644 (file)
index 0000000..3b904f3
--- /dev/null
@@ -0,0 +1,20 @@
+diff -dupr a/test/test_priority.py b/test/test_priority.py
+--- a/test/test_priority.py    2017-01-27 11:57:03.000000000 +0100
++++ b/test/test_priority.py    2019-11-22 09:03:52.772710452 +0100
+@@ -12,7 +12,7 @@ import itertools
+ import pytest
+-from hypothesis import given
++from hypothesis import given, settings
+ from hypothesis.strategies import (
+     integers, lists, tuples, sampled_from
+ )
+@@ -489,6 +489,7 @@ class TestPriorityTreeOutput(object):
+     fairness and equidistribution.
+     """
+     @given(STREAMS_AND_WEIGHTS)
++    @settings(deadline=None)
+     def test_period_of_repetition(self, streams_and_weights):
+         """
+         The period of repetition of a priority sequence is given by the sum of
index 7ce73432ed636cd5d13b1281ac9a1411b1b115e5..fc22a3fbb74540d50466ec0e50559a8de905ec94 100644 (file)
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy)
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy)
 
 inherit distutils-r1
 
@@ -15,18 +15,14 @@ SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86"
-IUSE="test"
-
-RDEPEND=""
 
 DEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
-       test? (
-               >=dev-python/pytest-2.9.2[${PYTHON_USEDEP}]
-               >=dev-python/hypothesis-3.4.2[${PYTHON_USEDEP}]
-       )
+       test? ( >=dev-python/hypothesis-3.4.2[${PYTHON_USEDEP}] )
 "
 
-python_test() {
-       py.test -vv || die "Tests failed under ${EPYTHON}"
-}
+PATCHES=(
+       "${FILESDIR}"/priority-1.3.0-test-timeout.patch
+)
+
+distutils_enable_tests pytest