Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/pytest.git#eb7b60b3ca095aaef7536a7e93958231d532929b
This commit is contained in:
DistroBaker 2021-01-20 11:04:17 +00:00
parent 4c56059027
commit 054a77b06d
2 changed files with 38 additions and 1 deletions

26
d9ac2efbcd.patch Normal file
View File

@ -0,0 +1,26 @@
From d9ac2efbcdee123f73edf1829c8bd6a91be3b6d2 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
---
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:

View File

@ -1,11 +1,14 @@
Name: pytest
Version: 6.0.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Simple powerful testing with Python
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.
@ -129,6 +132,11 @@ find %{buildroot}%{python3_sitelib} \
%if %{with tests}
%check
# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1914843
# upstream: https://github.com/pytest-dev/pytest/issues/8256
echo "set enable-bracketed-paste off" > .inputrc
export INPUTRC=$PWD/.inputrc
%global __pytest %{buildroot}%{_bindir}/pytest
%pytest testing %{?with_timeout:--timeout=30}
%endif
@ -152,6 +160,9 @@ find %{buildroot}%{python3_sitelib} \
%{python3_sitelib}/pytest/
%changelog
* Wed Jan 20 2021 Miro Hrončok <mhroncok@redhat.com> - 6.0.2-2
- Workaround the bracketed-paste mode breaking tests with Bash 5.1+
* Sat Sep 12 2020 Thomas Moschny <thomas.moschny@gmx.de> - 6.0.2-1
- Update to 6.0.2.