Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-timeout/, dev-python/pytest-timeout/files/
Date: Sat, 01 Aug 2020 22:29:48
Message-Id: 1596320980.2b5ff91101ffed5aa0667b8f1cd0e288c894935f.mgorny@gentoo
1 commit: 2b5ff91101ffed5aa0667b8f1cd0e288c894935f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 1 22:24:37 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 1 22:29:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b5ff911
7
8 dev-python/pytest-timeout: Fix testing without pytest-cov
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../files/pytest-timeout-1.4.2-optional-cov.patch | 27 ++++++++++++++++++++++
13 .../pytest-timeout/pytest-timeout-1.4.1-r1.ebuild | 4 ++++
14 .../pytest-timeout/pytest-timeout-1.4.2.ebuild | 4 ++++
15 3 files changed, 35 insertions(+)
16
17 diff --git a/dev-python/pytest-timeout/files/pytest-timeout-1.4.2-optional-cov.patch b/dev-python/pytest-timeout/files/pytest-timeout-1.4.2-optional-cov.patch
18 new file mode 100644
19 index 00000000000..424cfa6c57d
20 --- /dev/null
21 +++ b/dev-python/pytest-timeout/files/pytest-timeout-1.4.2-optional-cov.patch
22 @@ -0,0 +1,27 @@
23 +From 65a79fe8ceb52d7ae978f4a2ecc47a1fd34fda2b Mon Sep 17 00:00:00 2001
24 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
25 +Date: Sun, 2 Aug 2020 00:11:53 +0200
26 +Subject: [PATCH] Skip test_cov if pytest-cov is not installed
27 +
28 +Skip test_cov gracefully if pytest_cov module can't be imported.
29 +This would help us since we're removing py2 support from pytest-cov
30 +but still need it for pytest-timeout.
31 +---
32 + test_pytest_timeout.py | 1 +
33 + 1 file changed, 1 insertion(+)
34 +
35 +diff --git a/test_pytest_timeout.py b/test_pytest_timeout.py
36 +index 16302d7..69707b4 100644
37 +--- a/test_pytest_timeout.py
38 ++++ b/test_pytest_timeout.py
39 +@@ -77,6 +77,7 @@ def test_thread(testdir):
40 + )
41 + def test_cov(testdir):
42 + # This test requires pytest-cov
43 ++ pytest.importorskip("pytest_cov")
44 + testdir.makepyfile(
45 + """
46 + import time
47 +--
48 +2.28.0
49 +
50
51 diff --git a/dev-python/pytest-timeout/pytest-timeout-1.4.1-r1.ebuild b/dev-python/pytest-timeout/pytest-timeout-1.4.1-r1.ebuild
52 index 56fd0feec5d..2821063d308 100644
53 --- a/dev-python/pytest-timeout/pytest-timeout-1.4.1-r1.ebuild
54 +++ b/dev-python/pytest-timeout/pytest-timeout-1.4.1-r1.ebuild
55 @@ -28,6 +28,10 @@ BDEPEND="
56
57 distutils_enable_tests pytest
58
59 +PATCHES=(
60 + "${FILESDIR}"/pytest-timeout-1.4.2-optional-cov.patch
61 +)
62 +
63 python_test() {
64 distutils_install_for_testing
65
66
67 diff --git a/dev-python/pytest-timeout/pytest-timeout-1.4.2.ebuild b/dev-python/pytest-timeout/pytest-timeout-1.4.2.ebuild
68 index 56fd0feec5d..2821063d308 100644
69 --- a/dev-python/pytest-timeout/pytest-timeout-1.4.2.ebuild
70 +++ b/dev-python/pytest-timeout/pytest-timeout-1.4.2.ebuild
71 @@ -28,6 +28,10 @@ BDEPEND="
72
73 distutils_enable_tests pytest
74
75 +PATCHES=(
76 + "${FILESDIR}"/pytest-timeout-1.4.2-optional-cov.patch
77 +)
78 +
79 python_test() {
80 distutils_install_for_testing