summaryrefslogtreecommitdiff
path: root/dev-python/pytest-cov
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pytest-cov')
-rw-r--r--dev-python/pytest-cov/Manifest4
-rw-r--r--dev-python/pytest-cov/files/pytest-cov-3.0.0-coverage-6.2.patch30
-rw-r--r--dev-python/pytest-cov/pytest-cov-3.0.0-r1.ebuild60
-rw-r--r--dev-python/pytest-cov/pytest-cov-3.0.0.ebuild21
4 files changed, 110 insertions, 5 deletions
diff --git a/dev-python/pytest-cov/Manifest b/dev-python/pytest-cov/Manifest
index 94f64c600f38..e9b57ced8c7d 100644
--- a/dev-python/pytest-cov/Manifest
+++ b/dev-python/pytest-cov/Manifest
@@ -1,3 +1,5 @@
+AUX pytest-cov-3.0.0-coverage-6.2.patch 1034 BLAKE2B 433d761faae7c929b09e6d7a346fa1129acb427939756efa4d465ed6a6a20fb45ad09f890ce9d9b95c45862bc072a20d9038a1acca06de1963008119188b3e87 SHA512 85501e1c16f9716a3c2b04c79786e657e71ed58a6b0d338458e4cd17abff19eb85dd4b4c6d427e5f17d259d8ce970e79682c613a51b252cd506b1cd895fd8ee6
DIST pytest-cov-3.0.0.tar.gz 61440 BLAKE2B 85f0b079c4c373191553271e34e78af68ac69ea53e3721aa0d43eb9dd55be935570eb15c0f8b954e4c0de6201c004ddef435ea70b03cfda893ecdcc230c283e7 SHA512 289d1b1e29dcc3461276de4c1bbd3884e4ec957efb7dd4c330bc3f25f1b978cbee64c0e2882b419eee5f9ccf44c9d1a23ce47a1b7cc7e436b9ebe894e4c11ae8
-EBUILD pytest-cov-3.0.0.ebuild 1209 BLAKE2B ee33bc35a3a8196e65b38572543c97970c806eec171a0d706b50bddc94b4b6f90ac333190c92a9f75735ec30af4b081f64d20942a83bbc2d9f46660468c61458 SHA512 d7993a62fa06bc2c2c886d0b79008843fddce59bb09bed88aff1073f388f66e3dd631c356bf1ba23cd05c4f02d5bd13a4ceaf4ad386ea91379a238d4655517cc
+EBUILD pytest-cov-3.0.0-r1.ebuild 1704 BLAKE2B 80317302662047b07facb3b11f4a6aeb4893153ee03af655dd36243febd998f8e1a8113140fecea49ffb800632abcb8d5815cf0b25dbed85678c3080df3503ba SHA512 5154d849468fe65cff28965785329cb37af1e177d4968446c6fe130cb5100561875142960da17075b91c79ff8bee299dd43720daa96431bee2d858afe8f83116
+EBUILD pytest-cov-3.0.0.ebuild 1520 BLAKE2B 0b07066995ad9101dcee737a76c2cae098039ff23d9a4b001310ce99696db263d6cafd21ffbc77d56a24afeddd35b51fe110544a0a1b0b642022711d6601c1da SHA512 c6ac0f857a31c2d35fee3dd61a4e102889d6e9ea96dd0bca383e29cbc59ad7c3b4a43f9c350f3f1abddbc797a58fa35a976cb7e600f639ba62fec564e83429ad
MISC metadata.xml 412 BLAKE2B 0d79131c6fd8adf72493a7c333959e065cf4f2231f6c770800b6d05ff9afcc246cd202406bea6e28f6b0fd23ee6197aa8dac2dd59d0a89d9b07741f57e8fa5e8 SHA512 d1aab9ea8042bf810398a4195fd3595a8abbeb060ab38fd7b7e40085c8d5f22ecb78bab02e2331d4588199d88e0d3848413d75a18fe4373ecd9940a3c990c604
diff --git a/dev-python/pytest-cov/files/pytest-cov-3.0.0-coverage-6.2.patch b/dev-python/pytest-cov/files/pytest-cov-3.0.0-coverage-6.2.patch
new file mode 100644
index 000000000000..b44326d8b60d
--- /dev/null
+++ b/dev-python/pytest-cov/files/pytest-cov-3.0.0-coverage-6.2.patch
@@ -0,0 +1,30 @@
+From 6d06678a76d9275beb48917d7653ea6a610c7717 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 23 Jan 2022 15:03:35 +0100
+Subject: [PATCH] Update test_invalid_coverage_source for coverage-6.2
+
+Update test_invalid_coverage_source to make the "No data was collected"
+less strict, as the output has changed in coverage-6.2. This solution
+was suggested by Tom Callaway (@spotrh) on the linked bug.
+
+Fixes #509
+---
+ tests/test_pytest_cov.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py
+index f93d352..6d97949 100644
+--- a/tests/test_pytest_cov.py
++++ b/tests/test_pytest_cov.py
+@@ -981,7 +981,7 @@ def test_invalid_coverage_source(testdir):
+ '*10 passed*'
+ ])
+ result.stderr.fnmatch_lines([
+- 'Coverage.py warning: No data was collected.*'
++ '*No data was collected.*'
+ ])
+ result.stdout.fnmatch_lines([
+ '*Failed to generate report: No data to report.',
+--
+2.34.1
+
diff --git a/dev-python/pytest-cov/pytest-cov-3.0.0-r1.ebuild b/dev-python/pytest-cov/pytest-cov-3.0.0-r1.ebuild
new file mode 100644
index 000000000000..99769d655c19
--- /dev/null
+++ b/dev-python/pytest-cov/pytest-cov-3.0.0-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+inherit distutils-r1
+
+DESCRIPTION="py.test plugin for coverage reporting"
+HOMEPAGE="https://github.com/pytest-dev/pytest-cov https://pypi.org/project/pytest-cov/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+RDEPEND="
+ >=dev-python/py-1.4.22[${PYTHON_USEDEP}]
+ >=dev-python/pytest-3.6[${PYTHON_USEDEP}]
+ >=dev-python/coverage-4.4[${PYTHON_USEDEP}]
+ dev-python/toml[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ dev-python/virtualenv[${PYTHON_USEDEP}]
+ dev-python/fields[${PYTHON_USEDEP}]
+ >=dev-python/process-tests-2.0.2[${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_sphinx docs \
+ dev-python/sphinx-py3doc-enhanced-theme
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/pytest-dev/pytest-cov/pull/518
+ "${FILESDIR}"/${P}-coverage-6.2.patch
+)
+
+python_test() {
+ # NB: disabling all plugins speeds tests up a lot
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local -x PYTEST_PLUGINS=pytest_cov.plugin,xdist.plugin,xdist.looponfail
+
+ local EPYTEST_DESELECT=(
+ # attempts to install packages via pip (network)
+ tests/test_pytest_cov.py::test_dist_missing_data
+ )
+
+ # TODO: why do we need to do that?!
+ # https://github.com/pytest-dev/pytest-cov/issues/517
+ ln -s "${BROOT}$(python_get_sitedir)/coverage" \
+ "${BUILD_DIR}/install$(python_get_sitedir)/coverage" || die
+
+ epytest -x
+
+ rm "${BUILD_DIR}/install$(python_get_sitedir)/coverage" || die
+}
diff --git a/dev-python/pytest-cov/pytest-cov-3.0.0.ebuild b/dev-python/pytest-cov/pytest-cov-3.0.0.ebuild
index 4d424eac1bdd..9c14153ab26d 100644
--- a/dev-python/pytest-cov/pytest-cov-3.0.0.ebuild
+++ b/dev-python/pytest-cov/pytest-cov-3.0.0.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=8
@@ -36,7 +36,20 @@ distutils_enable_sphinx docs \
dev-python/sphinx-py3doc-enhanced-theme
distutils_enable_tests pytest
-EPYTEST_DESELECT=(
- # attempts to install packages via pip (network)
- tests/test_pytest_cov.py::test_dist_missing_data
+PATCHES=(
+ # https://github.com/pytest-dev/pytest-cov/pull/518
+ "${FILESDIR}"/${P}-coverage-6.2.patch
)
+
+python_test() {
+ # NB: disabling all plugins speeds tests up a lot
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local -x PYTEST_PLUGINS=pytest_cov.plugin,xdist.plugin,xdist.looponfail
+
+ local EPYTEST_DESELECT=(
+ # attempts to install packages via pip (network)
+ tests/test_pytest_cov.py::test_dist_missing_data
+ )
+
+ epytest
+}