#2 Python 3.10 compatibility backport
Merged 3 years ago by churchyard. Opened 3 years ago by churchyard.
rpms/ churchyard/python-pytest4 python3.10  into  master

file added
+29
@@ -0,0 +1,29 @@ 

+ From 90aaeebc8e699f04e7f9a5a4306a954029adacfc Mon Sep 17 00:00:00 2001

+ From: Ran Benita <ran@unusedvar.com>

+ Date: Sun, 25 Oct 2020 01:08:12 +0200

+ Subject: [PATCH] testing: python 3.10 fix

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ Co-Authored-By: Miro Hrončok <miro@hroncok.cz>

+ ---

+  testing/test_runner.py | 4 +++-

+  1 file changed, 3 insertions(+), 1 deletion(-)

+ 

+ diff --git a/testing/test_runner.py b/testing/test_runner.py

+ index 6906efb910..804c2831c8 100644

+ --- a/testing/test_runner.py

+ +++ b/testing/test_runner.py

+ @@ -336,8 +336,10 @@ def test_method(self):

+          assert reps[2].failed

+          assert reps[2].when == "teardown"

+          assert reps[2].longrepr.reprcrash.message in (

+ -            # python3 error

+ +            # python3 < 3.10 error

+              "TypeError: teardown_method() missing 2 required positional arguments: 'y' and 'z'",

+ +            # python3 >= 3.10 error

+ +            "TypeError: TestClass.teardown_method() missing 2 required positional arguments: 'y' and 'z'",

+              # python2 error

+              "TypeError: teardown_method() takes exactly 4 arguments (2 given)",

+          )

file modified
+3
@@ -6,6 +6,9 @@ 

  URL:            https://pytest.org

  Source0:        %{pypi_source pytest}

  

+ # Python 3.10 compatibility

+ Patch1:         https://github.com/pytest-dev/pytest/commit/90aaeebc8e.patch

+ 

  # The test in this specfile use pytest-timeout

  # When building pytest for the first time with new Python version

  # that is not possible as it depends on pytest