Update to 7.1.3.

This commit is contained in:
Thomas Moschny 2022-09-05 16:48:52 +02:00 committed by Miro Hrončok
parent 9491c15f81
commit e41002857c
4 changed files with 57 additions and 69 deletions

View File

@ -1,63 +0,0 @@
From 09b2c9532090db84daa3aa1a243f90dc8709fc00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
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 "<doctest test_doctest_unexpected_exception.txt[1]>", line 1, in <module>',
"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",

View File

@ -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(

View File

@ -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 <thomas.moschny@gmx.de> - 7.1.3-1
- Update to 7.1.3
- Fixes: rhbz#2123701
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 7.1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (pytest-7.1.2.tar.gz) = e61c9b0a8fc053626da307d6bac1f5caab451c4948ef7c7f2e2f991c3433a55f81ec0d9412fca646c02f22e695c71e873ee48fc0ab0aad337ce01b70628df494
SHA512 (pytest-7.1.3.tar.gz) = 07a6b30fc90776dcd59972e2e4fc03ba02270bf1460faba765bfcf8b04888797be15a16a2ae947d97eb523250be200297d8a442870b3b6d56ae776b28fd18dce