summaryrefslogtreecommitdiff
path: root/dev-python/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/coverage')
-rw-r--r--dev-python/coverage/coverage-7.6.12.ebuild10
-rw-r--r--dev-python/coverage/files/coverage-7.6.12-pypy311.patch25
2 files changed, 33 insertions, 2 deletions
diff --git a/dev-python/coverage/coverage-7.6.12.ebuild b/dev-python/coverage/coverage-7.6.12.ebuild
index 847a764009a0..a3aaf78c2c0a 100644
--- a/dev-python/coverage/coverage-7.6.12.ebuild
+++ b/dev-python/coverage/coverage-7.6.12.ebuild
@@ -39,8 +39,14 @@ BDEPEND="
distutils_enable_tests pytest
src_prepare() {
- sed -i -e '/addopts/s:-q -n auto::' pyproject.toml || die
+ local PATCHES=(
+ # https://github.com/nedbat/coveragepy/pull/1929
+ "${FILESDIR}/${P}-pypy311.patch"
+ )
+
distutils-r1_src_prepare
+
+ sed -i -e '/addopts/s:-q -n auto::' pyproject.toml || die
}
python_compile() {
@@ -97,7 +103,7 @@ python_test() {
test_tracer pytrace
case ${EPYTHON} in
- python3.1[01]|pypy3)
+ python3.1[01]|pypy3|pypy3.11)
;;
*)
# available since Python 3.12
diff --git a/dev-python/coverage/files/coverage-7.6.12-pypy311.patch b/dev-python/coverage/files/coverage-7.6.12-pypy311.patch
new file mode 100644
index 000000000000..62fa908d8ca9
--- /dev/null
+++ b/dev-python/coverage/files/coverage-7.6.12-pypy311.patch
@@ -0,0 +1,25 @@
+From 059be065e28551d4b029c8d525fafdaea3df4a3d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 18 Feb 2025 11:10:21 +0100
+Subject: [PATCH 1/2] test: Fix expected exception message for PyPy3.11
+
+Fix the regex in `test_parser.py::PythonParserTest::test_not_python`
+to account for the possibility of code being wrapped in double quotes
+rather than single quotes, to fix the test on PyPy3.11.
+---
+ tests/test_parser.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_parser.py b/tests/test_parser.py
+index 2ab30853..a9a247ff 100644
+--- a/tests/test_parser.py
++++ b/tests/test_parser.py
+@@ -123,7 +123,7 @@ class PythonParserTest(PythonParserTestBase):
+ )
+ ])
+ def test_not_python(self, text: str) -> None:
+- msg = r"Couldn't parse '<code>' as Python source: '.*' at line \d+"
++ msg = r"Couldn't parse '<code>' as Python source: ['\"].*['\"] at line \d+"
+ with pytest.raises(NotPython, match=msg):
+ _ = self.parse_text(text)
+