summaryrefslogtreecommitdiff
path: root/dev-python/pytest
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2021-06-03 01:34:20 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2021-06-03 01:34:20 +0000
commitf2fe63f9eee97aeef416cec2270b78aad31765ad (patch)
treeeb309c29f3dcb575af1a64ea5dcbd7fb525c7d4e /dev-python/pytest
parent8a5aa7a1e915da2b5215aa99bdb92254b01ebe5d (diff)
downloadbaldeagleos-repo-f2fe63f9eee97aeef416cec2270b78aad31765ad.tar.gz
baldeagleos-repo-f2fe63f9eee97aeef416cec2270b78aad31765ad.tar.xz
baldeagleos-repo-f2fe63f9eee97aeef416cec2270b78aad31765ad.zip
Adding metadata
Diffstat (limited to 'dev-python/pytest')
-rw-r--r--dev-python/pytest/files/pytest-6.2.4-py310.patch34
-rw-r--r--dev-python/pytest/pytest-6.2.4-r1.ebuild (renamed from dev-python/pytest/pytest-6.2.4.ebuild)4
2 files changed, 38 insertions, 0 deletions
diff --git a/dev-python/pytest/files/pytest-6.2.4-py310.patch b/dev-python/pytest/files/pytest-6.2.4-py310.patch
new file mode 100644
index 000000000000..88c8f703f08a
--- /dev/null
+++ b/dev-python/pytest/files/pytest-6.2.4-py310.patch
@@ -0,0 +1,34 @@
+From 78fb97105f38dc286353bbc331a243b6e753fe3c Mon Sep 17 00:00:00 2001
+From: Petr Viktorin <encukou@gmail.com>
+Date: Wed, 6 Jan 2021 13:33:33 +0100
+Subject: [PATCH] Make code.FormattedExcinfo.get_source more defensive
+
+When line_index was a large negative number, get_source failed
+on `source.lines[line_index]`.
+Use the same dummy Source as with a large positive line_index.
+---
+ src/_pytest/_code/code.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py
+index b85217560..af3bdf056 100644
+--- a/src/_pytest/_code/code.py
++++ b/src/_pytest/_code/code.py
+@@ -721,11 +721,11 @@ class FormattedExcinfo:
+ ) -> List[str]:
+ """Return formatted and marked up source lines."""
+ lines = []
+- if source is None or line_index >= len(source.lines):
++ if source is not None and line_index < 0:
++ line_index += len(source.lines)
++ if source is None or line_index >= len(source.lines) or line_index < 0:
+ source = Source("???")
+ line_index = 0
+- if line_index < 0:
+- line_index += len(source)
+ space_prefix = " "
+ if short:
+ lines.append(space_prefix + source.lines[line_index].strip())
+--
+2.31.1
+
diff --git a/dev-python/pytest/pytest-6.2.4.ebuild b/dev-python/pytest/pytest-6.2.4-r1.ebuild
index 27c33f540af8..e1c3b5d1583d 100644
--- a/dev-python/pytest/pytest-6.2.4.ebuild
+++ b/dev-python/pytest/pytest-6.2.4-r1.ebuild
@@ -43,6 +43,10 @@ BDEPEND="
' python3_{7..9} pypy3)
)"
+PATCHES=(
+ "${FILESDIR}"/${P}-py310.patch
+)
+
src_test() {
# workaround new readline defaults
echo "set enable-bracketed-paste off" > "${T}"/inputrc || die