dev-python/pytest: Increase timeouts in 4.6.10 for slower machines
authorMichał Górny <mgorny@gentoo.org>
Wed, 27 May 2020 06:10:11 +0000 (08:10 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 27 May 2020 06:10:56 +0000 (08:10 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/pytest/files/pytest-4.6.10-timeout.patch [new file with mode: 0644]
dev-python/pytest/pytest-4.6.10.ebuild

diff --git a/dev-python/pytest/files/pytest-4.6.10-timeout.patch b/dev-python/pytest/files/pytest-4.6.10-timeout.patch
new file mode 100644 (file)
index 0000000..5bf9bcd
--- /dev/null
@@ -0,0 +1,35 @@
+diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py
+index f1d739c99..72406b85d 100644
+--- a/src/_pytest/pytester.py
++++ b/src/_pytest/pytester.py
+@@ -1209,7 +1209,7 @@ class Testdir(object):
+         args = self._getpytestargs() + args
+         return self.run(*args, timeout=timeout)
+-    def spawn_pytest(self, string, expect_timeout=10.0):
++    def spawn_pytest(self, string, expect_timeout=60.0):
+         """Run pytest using pexpect.
+         This makes sure to use the right pytest and sets up the temporary
+@@ -1223,7 +1223,7 @@ class Testdir(object):
+         cmd = "%s --basetemp=%s %s" % (invoke, basetemp, string)
+         return self.spawn(cmd, expect_timeout=expect_timeout)
+-    def spawn(self, cmd, expect_timeout=10.0):
++    def spawn(self, cmd, expect_timeout=60.0):
+         """Run a command using pexpect.
+         The pexpect child is returned.
+diff --git a/testing/test_terminal.py b/testing/test_terminal.py
+index 1b2e46c7c..52ba80f46 100644
+--- a/testing/test_terminal.py
++++ b/testing/test_terminal.py
+@@ -138,7 +138,7 @@ class TestTerminal(object):
+             """
+             def test_1():
+                 import time
+-                time.sleep(20)
++                time.sleep(120)
+         """
+         )
+         child = testdir.spawn_pytest("")
index 76710136e68b82a6a860810ffffa6367fd0dee22..c8234af1fa7a36b1096ddf8b700ef521ee6d59f6 100644 (file)
@@ -60,6 +60,7 @@ DEPEND="
 
 PATCHES=(
        "${FILESDIR}/${PN}-4.5.0-strip-setuptools_scm.patch"
+       "${FILESDIR}/${P}-timeout.patch"
 )
 
 python_prepare_all() {