From e41002857cff2b5767a3a7390e496b748b5dc05c Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Mon, 5 Sep 2022 16:48:52 +0200 Subject: [PATCH] Update to 7.1.3. --- 10132.patch | 63 ----------------------------------- pytest-7.1.3-fix-xfails.patch | 48 ++++++++++++++++++++++++++ pytest.spec | 13 +++++--- sources | 2 +- 4 files changed, 57 insertions(+), 69 deletions(-) delete mode 100644 10132.patch create mode 100644 pytest-7.1.3-fix-xfails.patch diff --git a/10132.patch b/10132.patch deleted file mode 100644 index 37565b7..0000000 --- a/10132.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 09b2c9532090db84daa3aa1a243f90dc8709fc00 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Wed, 13 Jul 2022 17:06:33 +0200 -Subject: [PATCH] Adjust tests for a last minute Python 3.11 change in the - traceback format - -See https://github.com/python/cpython/issues/93883 -and https://github.com/python/cpython/pull/93994 - -Fixes https://github.com/pytest-dev/pytest/issues/10131 ---- - testing/test_doctest.py | 6 +++++- - testing/test_main.py | 6 +++--- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/testing/test_doctest.py b/testing/test_doctest.py -index 828253d322..2f73feb8c4 100644 ---- a/testing/test_doctest.py -+++ b/testing/test_doctest.py -@@ -223,7 +223,11 @@ def test_doctest_unexpected_exception(self, pytester: Pytester): - "Traceback (most recent call last):", - ' File "*/doctest.py", line *, in __run', - " *", -- *((" *^^^^*",) if sys.version_info >= (3, 11) else ()), -+ *( -+ (" *^^^^*",) -+ if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) -+ else () -+ ), - ' File "", line 1, in ', - "ZeroDivisionError: division by zero", - "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", -diff --git a/testing/test_main.py b/testing/test_main.py -index 2df51bb7bb..7159762679 100644 ---- a/testing/test_main.py -+++ b/testing/test_main.py -@@ -47,7 +47,7 @@ def pytest_internalerror(excrepr, excinfo): - - end_lines = ( - result.stdout.lines[-4:] -- if sys.version_info >= (3, 11) -+ if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) - else result.stdout.lines[-3:] - ) - -@@ -57,7 +57,7 @@ def pytest_internalerror(excrepr, excinfo): - 'INTERNALERROR> raise SystemExit("boom")', - *( - ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) -- if sys.version_info >= (3, 11) -+ if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) - else () - ), - "INTERNALERROR> SystemExit: boom", -@@ -68,7 +68,7 @@ def pytest_internalerror(excrepr, excinfo): - 'INTERNALERROR> raise ValueError("boom")', - *( - ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) -- if sys.version_info >= (3, 11) -+ if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) - else () - ), - "INTERNALERROR> ValueError: boom", diff --git a/pytest-7.1.3-fix-xfails.patch b/pytest-7.1.3-fix-xfails.patch new file mode 100644 index 0000000..1431e23 --- /dev/null +++ b/pytest-7.1.3-fix-xfails.patch @@ -0,0 +1,48 @@ +diff -up pytest-7.1.3/testing/test_debugging.py.orig pytest-7.1.3/testing/test_debugging.py +--- pytest-7.1.3/testing/test_debugging.py.orig 2022-09-02 13:12:55.000000000 +0200 ++++ pytest-7.1.3/testing/test_debugging.py 2022-09-05 16:40:54.921946205 +0200 +@@ -353,7 +353,7 @@ class TestPDB: + result = pytester.runpytest_subprocess("--pdb", ".") + result.stdout.fnmatch_lines(["-> import unknown"]) + +- @pytest.mark.xfail(reason="#10042") ++ @pytest.mark.xfail(reason="#10042", strict=False) + def test_pdb_interaction_capturing_simple(self, pytester: Pytester) -> None: + p1 = pytester.makepyfile( + """ +@@ -522,7 +522,7 @@ class TestPDB: + assert "BdbQuit" not in rest + assert "UNEXPECTED EXCEPTION" not in rest + +- @pytest.mark.xfail(reason="#10042") ++ @pytest.mark.xfail(reason="#10042", strict=False) + def test_pdb_interaction_capturing_twice(self, pytester: Pytester) -> None: + p1 = pytester.makepyfile( + """ +@@ -558,7 +558,7 @@ class TestPDB: + assert "1 failed" in rest + self.flush(child) + +- @pytest.mark.xfail(reason="#10042") ++ @pytest.mark.xfail(reason="#10042", strict=False) + def test_pdb_with_injected_do_debug(self, pytester: Pytester) -> None: + """Simulates pdbpp, which injects Pdb into do_debug, and uses + self.__class__ in do_continue. +@@ -1003,7 +1003,7 @@ class TestDebuggingBreakpoints: + assert "reading from stdin while output" not in rest + TestPDB.flush(child) + +- @pytest.mark.xfail(reason="#10042") ++ @pytest.mark.xfail(reason="#10042",strict=False) + def test_pdb_not_altered(self, pytester: Pytester) -> None: + p1 = pytester.makepyfile( + """ +@@ -1163,7 +1163,7 @@ def test_quit_with_swallowed_SystemExit( + + + @pytest.mark.parametrize("fixture", ("capfd", "capsys")) +-@pytest.mark.xfail(reason="#10042") ++@pytest.mark.xfail(reason="#10042", strict=False) + def test_pdb_suspends_fixture_capturing(pytester: Pytester, fixture: str) -> None: + """Using "-s" with pytest should suspend/resume fixture capturing.""" + p1 = pytester.makepyfile( diff --git a/pytest.spec b/pytest.spec index 5085be2..59a6413 100644 --- a/pytest.spec +++ b/pytest.spec @@ -1,15 +1,14 @@ Name: pytest -%global base_version 7.1.2 +%global base_version 7.1.3 #global prerelease ... Version: %{base_version}%{?prerelease:~%{prerelease}} -Release: 5%{?dist} +Release: 1%{?dist} Summary: Simple powerful testing with Python License: MIT URL: https://pytest.org Source: %{pypi_source pytest %{base_version}%{?prerelease}} - -# Adjust tests for a last minute Python 3.11 change in the traceback format -Patch: https://github.com/pytest-dev/pytest/pull/10132.patch +# see https://github.com/pytest-dev/pytest/issues/10042#issuecomment-1237132867 +Patch: pytest-7.1.3-fix-xfails.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. @@ -159,6 +158,10 @@ find %{buildroot}%{python3_sitelib} \ %changelog +* Sat Sep 3 2022 Thomas Moschny - 7.1.3-1 +- Update to 7.1.3 +- Fixes: rhbz#2123701 + * Fri Jul 22 2022 Fedora Release Engineering - 7.1.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index c541508..f5c8517 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pytest-7.1.2.tar.gz) = e61c9b0a8fc053626da307d6bac1f5caab451c4948ef7c7f2e2f991c3433a55f81ec0d9412fca646c02f22e695c71e873ee48fc0ab0aad337ce01b70628df494 +SHA512 (pytest-7.1.3.tar.gz) = 07a6b30fc90776dcd59972e2e4fc03ba02270bf1460faba765bfcf8b04888797be15a16a2ae947d97eb523250be200297d8a442870b3b6d56ae776b28fd18dce