From 76da6fc8a7c92ae8766d6e9294d895cd65e2196f Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Nov 20 2020 08:34:45 +0000 Subject: Python 3.10 compatibility backport --- diff --git a/d9ac2efbcd.patch b/d9ac2efbcd.patch new file mode 100644 index 0000000..d4c2c59 --- /dev/null +++ b/d9ac2efbcd.patch @@ -0,0 +1,26 @@ +From d9ac2efbcdee123f73edf1829c8bd6a91be3b6d2 Mon Sep 17 00:00:00 2001 +From: Ran Benita +Date: Sun, 25 Oct 2020 01:08:12 +0200 +Subject: [PATCH] testing: python 3.10 fix + +--- + testing/test_runner.py | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/testing/test_runner.py b/testing/test_runner.py +index 95b8f5fccb..a1f1db48d0 100644 +--- a/testing/test_runner.py ++++ b/testing/test_runner.py +@@ -336,10 +336,9 @@ def test_method(self): + assert reps[2].failed + assert reps[2].when == "teardown" + assert reps[2].longrepr.reprcrash.message in ( +- # python3 error + "TypeError: teardown_method() missing 2 required positional arguments: 'y' and 'z'", +- # python2 error +- "TypeError: teardown_method() takes exactly 4 arguments (2 given)", ++ # Python >= 3.10 ++ "TypeError: TestClass.teardown_method() missing 2 required positional arguments: 'y' and 'z'", + ) + + def test_failure_in_setup_function_ignores_custom_repr(self, testdir) -> None: diff --git a/pytest.spec b/pytest.spec index 1a8820f..7f033f1 100644 --- a/pytest.spec +++ b/pytest.spec @@ -6,6 +6,9 @@ License: MIT URL: https://pytest.org Source0: %{pypi_source} +# Python 3.10 compatibility +Patch1: https://github.com/pytest-dev/pytest/commit/d9ac2efbcd.patch + # When building pytest for the first time with new Python version # we might not yet have all the BRs, those conditionals allow us to do that.