From cad86f73367eff59a1d6daff44d262c3852f01f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 12 Jul 2021 10:24:49 +0200 Subject: [PATCH] Adjust pytest's own tests for changes in Python 3.10.0b4 See https://github.com/pytest-dev/pytest/pull/8555#issuecomment-877881571 See https://mail.python.org/archives/list/python-dev@python.org/message/LSTMFAPSPD3BGZ4D6HQFODXZVB3PLYKF/ --- 8555.patch | 54 ----------------------------------------------------- pytest.spec | 7 +++++-- 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/8555.patch b/8555.patch index 7c8e9ea..1c42a02 100644 --- a/8555.patch +++ b/8555.patch @@ -31,60 +31,6 @@ index dd4be6c..6fc4184 100644 markers = [ -From b4d2330fd4c8a9661d981f9a63b3d029bbf674d9 Mon Sep 17 00:00:00 2001 -From: Florian Bruhin -Date: Wed, 14 Apr 2021 11:37:34 +0200 -Subject: [PATCH] Adjust enum reprs for Python 3.10 - -Potential fix for #8546 ---- - testing/python/metafunc.py | 5 ++++- - testing/test_pytester.py | 14 ++++++++++---- - 2 files changed, 14 insertions(+), 5 deletions(-) - -diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py -index 676f1d9..21ab226 100644 ---- a/testing/python/metafunc.py -+++ b/testing/python/metafunc.py -@@ -448,7 +448,10 @@ class TestMetafunc: - enum = pytest.importorskip("enum") - e = enum.Enum("Foo", "one, two") - result = idmaker(("a", "b"), [pytest.param(e.one, e.two)]) -- assert result == ["Foo.one-Foo.two"] -+ if sys.version_info[:2] >= (3, 10): -+ assert result == ["one-two"] -+ else: -+ assert result == ["Foo.one-Foo.two"] - - def test_idmaker_idfn(self) -> None: - """#351""" -diff --git a/testing/test_pytester.py b/testing/test_pytester.py -index f2e8dd5..4234cdf 100644 ---- a/testing/test_pytester.py -+++ b/testing/test_pytester.py -@@ -741,10 +741,16 @@ def test_run_result_repr() -> None: - - # known exit code - r = pytester.RunResult(1, outlines, errlines, duration=0.5) -- assert ( -- repr(r) == "" -- ) -+ if sys.version_info[:2] >= (3, 10): -+ assert repr(r) == ( -+ "" -+ ) -+ else: -+ assert repr(r) == ( -+ "" -+ ) - - # unknown exit code: just the number - r = pytester.RunResult(99, outlines, errlines, duration=0.5) - - From 99dedde9c9e77e454e28f7811fcc27018d74686c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 4 May 2021 14:27:21 +0200 diff --git a/pytest.spec b/pytest.spec index c959ecc..18de827 100644 --- a/pytest.spec +++ b/pytest.spec @@ -1,6 +1,6 @@ Name: pytest Version: 6.2.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Simple powerful testing with Python License: MIT URL: https://pytest.org @@ -13,7 +13,7 @@ Patch1: 8227.patch # Fix Python 3.10 test issues # Merged upstream, https://github.com/pytest-dev/pytest/pull/8555 -# Rebased slightly +# Rebased slightly, one commit removed after Python 3.10.0b4 Patch2: 8555.patch # Ignore DeprecationWarnings in test_trial_error @@ -172,6 +172,9 @@ export INPUTRC=$PWD/.inputrc %{python3_sitelib}/pytest/ %changelog +* Mon Jul 12 2021 Miro HronĨok - 6.2.4-4 +- Adjust pytest's own tests for changes in Python 3.10.0b4 + * Fri Jun 04 2021 Python Maint - 6.2.4-3 - Rebuilt for Python 3.10