commit:     fd729bdd54045325b203dc69b461bfa8de1b4920
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 28 20:53:59 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 28 21:50:27 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd729bdd

dev-python/pytest: Backport py3.10 test fixes

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pytest/files/pytest-6.2.5-py310.patch | 81 ++++++++++++++++++++++++
 dev-python/pytest/pytest-6.2.5-r2.ebuild         |  5 ++
 2 files changed, 86 insertions(+)

diff --git a/dev-python/pytest/files/pytest-6.2.5-py310.patch 
b/dev-python/pytest/files/pytest-6.2.5-py310.patch
new file mode 100644
index 000000000000..89ca41954273
--- /dev/null
+++ b/dev-python/pytest/files/pytest-6.2.5-py310.patch
@@ -0,0 +1,81 @@
+From 5082686349185ef35f64d1a998a3062ee5a48771 Mon Sep 17 00:00:00 2001
+From: Ran Benita <[email protected]>
+Date: Thu, 13 May 2021 17:27:43 +0300
+Subject: [PATCH 1/2] Merge pull request #8664 from
+ hroncok/test_unittest-ignore_DeprecationWarning-from-twisted
+
+Ignore DeprecationWarnings in test_trial_error
+
+(cherry picked from commit 850a8447792f89c7d38c72b2f542536655ab0354)
+---
+ testing/test_unittest.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/testing/test_unittest.py b/testing/test_unittest.py
+index 8b00cb826..de8fc5c55 100644
+--- a/testing/test_unittest.py
++++ b/testing/test_unittest.py
+@@ -533,7 +533,9 @@ class TestTrialUnittest:
+                 # will crash both at test time and at teardown
+         """
+         )
+-        result = testdir.runpytest("-vv", "-oconsole_output_style=classic")
++        result = testdir.runpytest(
++            "-vv", "-oconsole_output_style=classic", "-W", 
"ignore::DeprecationWarning"
++        )
+         result.stdout.fnmatch_lines(
+             [
+                 "test_trial_error.py::TC::test_four FAILED",
+-- 
+2.35.0
+
+From 932792c22a300fc7794f966851df2b996f4a79bc Mon Sep 17 00:00:00 2001
+From: Bruno Oliveira <[email protected]>
+Date: Thu, 16 Dec 2021 10:37:52 -0300
+Subject: [PATCH 2/2] Merge pull request #9417 from
+ nicoddemus/fix-py3.10.1-9413
+
+(cherry picked from commit 47df71d23ff13bd083b21ffcf839bd11169b42fc)
+---
+ .github/workflows/main.yml | 4 ++--
+ testing/test_skipping.py   | 2 --
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
+index 5a9435357..a8a6406c6 100644
+--- a/.github/workflows/main.yml
++++ b/.github/workflows/main.yml
+@@ -75,7 +75,7 @@ jobs:
+             os: windows-latest
+             tox_env: "py39-xdist"
+           - name: "windows-py310"
+-            python: "3.10-dev"
++            python: "3.10.1"
+             os: windows-latest
+             tox_env: "py310-xdist"
+ 
+@@ -105,7 +105,7 @@ jobs:
+             os: ubuntu-latest
+             tox_env: "py39-xdist"
+           - name: "ubuntu-py310"
+-            python: "3.10-dev"
++            python: "3.10.1"
+             os: ubuntu-latest
+             tox_env: "py310-xdist"
+           - name: "ubuntu-pypy3"
+diff --git a/testing/test_skipping.py b/testing/test_skipping.py
+index 3cb8bdff2..487793645 100644
+--- a/testing/test_skipping.py
++++ b/testing/test_skipping.py
+@@ -1126,8 +1126,6 @@ def test_errors_in_xfail_skip_expressions(pytester: 
Pytester) -> None:
+     pypy_version_info = getattr(sys, "pypy_version_info", None)
+     if pypy_version_info is not None and pypy_version_info < (6,):
+         markline = markline[5:]
+-    elif sys.version_info[:2] >= (3, 10):
+-        markline = markline[11:]
+     elif sys.version_info >= (3, 8) or hasattr(sys, "pypy_version_info"):
+         markline = markline[4:]
+ 
+-- 
+2.35.0
+

diff --git a/dev-python/pytest/pytest-6.2.5-r2.ebuild 
b/dev-python/pytest/pytest-6.2.5-r2.ebuild
index 51a2aecdd80a..e1ab42664254 100644
--- a/dev-python/pytest/pytest-6.2.5-r2.ebuild
+++ b/dev-python/pytest/pytest-6.2.5-r2.ebuild
@@ -38,6 +38,11 @@ BDEPEND="
                dev-python/xmlschema[${PYTHON_USEDEP}]
        )"
 
+PATCHES=(
+       # backport fixes for py3.10 test regressions
+       "${FILESDIR}"/${P}-py310.patch
+)
+
 src_test() {
        # workaround new readline defaults
        echo "set enable-bracketed-paste off" > "${T}"/inputrc || die

Reply via email to