Compare commits

...

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

2
.gitignore vendored

@ -1 +1 @@
SOURCES/pytest-6.2.2.tar.gz
SOURCES/pytest-7.4.3.tar.gz

@ -1 +1 @@
f76ce196096c05575a0a18d02c9adcb85a122b3b SOURCES/pytest-6.2.2.tar.gz
6661c489fc21ea8714b6df6c3fcbd71b453bc555 SOURCES/pytest-7.4.3.tar.gz

@ -0,0 +1,58 @@
From 052d1453544511c72674c20b47723e401fd0f8f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Mon, 13 Nov 2023 09:45:05 +0100
Subject: [PATCH] XFAIL TestLocalPath.test_make_numbered_dir_multiprocess_safe
The tested py.path.local.make_numbered_dir function is *not*
multiprocess safe, because is uses os.listdir which itself is not.
The os.listdir documentation explicitly states that:
> If a file is removed from or added to the directory during the call
> of this function, whether a name for that file be included is unspecified.
This can lead to a race when:
1. process A attempts to create directory N
2. the creation fails, as another process already created it in the meantime
3. process A calls listdir to determine a more recent maxnum
4. processes B+ repeatedly create newer directories and they delete directory N
5. process A doesn't have directory N or any newer directory in listdir result
6. process A attempts to create directory N again and raises
For details, see https://github.com/pytest-dev/pytest/issues/11603#issuecomment-1805708144
and bellow.
Additionally, the test itself has a race in batch_make_numbered_dirs.
When this functions attempts to write to repro-N/foo,
repro-N may have already been removed by another process.
For details, see https://github.com/pytest-dev/pytest/issues/11603#issuecomment-1804714313
and bellow.
---
The tested py.path.local.make_numbered_dir function is not used in pytest.
There is a different implementation in _pytest.pathlib.
We plan to remove this module eventually anyway.
Closes https://github.com/pytest-dev/pytest/issues/11603
---
testing/_py/test_local.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py
index aebee380cb..77a9838cf1 100644
--- a/testing/_py/test_local.py
+++ b/testing/_py/test_local.py
@@ -868,6 +868,9 @@ def test_fspath_protocol_other_class(self, fake_fspath_obj):
py_path.strpath, str_path
)
+ @pytest.mark.xfail(
+ reason="#11603", raises=(error.EEXIST, error.ENOENT), strict=False
+ )
def test_make_numbered_dir_multiprocess_safe(self, tmpdir):
# https://github.com/pytest-dev/py/issues/30
with multiprocessing.Pool() as pool:

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

@ -1,49 +1,53 @@
Name: pytest
Version: 6.2.2
Release: 6%{?dist}
%global base_version 7.4.3
#global prerelease ...
Version: %{base_version}%{?prerelease:~%{prerelease}}
Release: 5%{?dist}
Summary: Simple powerful testing with Python
License: MIT
URL: https://pytest.org
Source0: %{pypi_source}
Source: %{pypi_source pytest %{base_version}%{?prerelease}}
# see https://github.com/pytest-dev/pytest/issues/10042#issuecomment-1237132867
Patch: pytest-7.1.3-fix-xfails.patch
# XFAIL TestLocalPath.test_make_numbered_dir_multiprocess_safe
Patch: https://github.com/pytest-dev/pytest/pull/11611.patch
# Remove -s from Python shebang,
# ensure that packages installed with pip to user locations are testable
# https://bugzilla.redhat.com/2152171
%undefine _py3_shebang_s
# 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.
# Disable tests on RHEL9 as to not pull in the test dependencies
# Specify --with tests to run the tests e.g. on EPEL
%bcond_with tests
# This can be used to disable all tests for faster bootstrapping.
# The tests are enabled by default except when building on RHEL/ELN
# (to avoid pulling in extra dependencies into next RHEL).
%bcond tests %{undefined rhel}
# Only disabling the optional tests is a more complex but careful approach
# Pytest will skip the related tests, so we only conditionalize the BRs
# This bcond is ignored when tests are disabled
%bcond_without optional_tests
%bcond optional_tests %{with tests}
# To run the tests in %%check we use pytest-timeout
# When building pytest for the first time with new Python version
# that is not possible as it depends on pytest
# The bcond is ignored when tests are disabled
%bcond_without timeout
%bcond timeout %{with tests}
# Disable documentation on RHEL9 as to not pull in the docs dependencies
# Specify --with docs to generate the documentation e.g. on EPEL
%bcond_with docs
# When building pytest for the first time with new Python version
# we also don't have sphinx yet and cannot build docs.
# The docs are enabled by default except when building on RHEL/ELN
# (to avoid pulling in extra dependencies into next RHEL).
%bcond docs %{undefined rhel}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
# Those are also runtime deps, needed for tests and docs
# We keep them unconditionality, so we don't accidentally build pytest
# before them and get broken dependencies
BuildRequires: python3-attrs
BuildRequires: python3-iniconfig
BuildRequires: python3-packaging
BuildRequires: python3-pluggy >= 0.12
BuildRequires: python3-py >= 1.5.0
BuildRequires: python3-toml
BuildRequires: pyproject-rpm-macros >= 0-51
%if %{with tests}
BuildRequires: python3-hypothesis
# we avoid using %%pyproject_buildrequires -x testing as it mixes optional and non-optional deps
BuildRequires: python3-attrs >= 19.2
BuildRequires: python3-hypothesis >= 3.56
BuildRequires: python3-pygments >= 2.7.2
BuildRequires: python3-xmlschema
%if %{with optional_tests}
BuildRequires: python3-argcomplete
@ -65,11 +69,16 @@ BuildRequires: python3-pytest-timeout
%if %{with docs}
BuildRequires: %{_bindir}/rst2html
# pluggy >= 1 is needed to build the docs, older versions are allowed on runtime:
BuildRequires: python3-pluggy >= 1
BuildRequires: python3-pygments-pytest
BuildRequires: python3-Pallets-Sphinx-Themes
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx-removed-in
BuildRequires: python3-sphinxcontrib-trio
# See doc/en/conf.py -- sphinxcontrib.inkscapeconverter is only used when inkscape is available
# we don't BR inkscape so we generally don't need it, but in case inkscape is installed accidentally:
BuildRequires: (python3-sphinxcontrib-inkscapeconverter if inkscape)
BuildRequires: make
%endif
@ -88,23 +97,41 @@ Provides: pytest = %{version}-%{release}
The pytest framework makes it easy to write small tests, yet scales to support
complex functional testing for applications and libraries.
%prep
%autosetup -p1 -n %{name}-%{version}
%autosetup -p1 -n %{name}-%{base_version}%{?prerelease}
# Between 7.2.0 and 7.2.1 the tests were updated for pygments 2.14.
# See https://github.com/pytest-dev/pytest/pull/10632 + 10637 (backport to 7.2).
# To make the tests work with pygments 2.13, we set the added {endline}s to empty.
# Once pygments 2.14+ is omnipresent, feel free to remove this hack,
# but bump the minimal BuildRequired version of python3-pygments to 2.14.
%if v"0%(%{python3} -c "import pygments; print(pygments.__version__)" 2>/dev/null)" < v"2.14~~"
sed -i 's/"endline": "\\x1b\[90m\\x1b\[39;49;00m",/"endline": "",/' testing/conftest.py
%endif
%generate_buildrequires
%pyproject_buildrequires -r
%build
%py3_build
%pyproject_wheel
%if %{with docs}
for l in doc/* ; do
make -C $l html PYTHONPATH=$(pwd)/src SPHINXBUILD=%{_bindir}/sphinx-build-3
%make_build -C $l html PYTHONPATH="$(pwd)/src"
done
for f in README CHANGELOG CONTRIBUTING ; do
rst2html ${f}.rst > ${f}.html
done
%endif
%install
%py3_install
%pyproject_install
%pyproject_save_files _pytest pytest py
mv %{buildroot}%{_bindir}/pytest %{buildroot}%{_bindir}/pytest-%{python3_version}
ln -snf pytest-%{python3_version} %{buildroot}%{_bindir}/pytest-3
mv %{buildroot}%{_bindir}/py.test %{buildroot}%{_bindir}/py.test-%{python3_version}
@ -128,54 +155,180 @@ find %{buildroot}%{python3_sitelib} \
-name '*.py' \
-exec sed -i -e '1{/^#!/d}' {} \;
%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
%check
%if %{with tests}
%global __pytest %{buildroot}%{_bindir}/pytest
%pytest testing %{?with_timeout:--timeout=30} -rs
# optional_tests deps contain pytest-xdist, so we can use it to run tests faster
%pytest testing %{?with_timeout:--timeout=30} %{?with_optional_tests:-n auto} -rs
%else
%pyproject_check_import
%endif
%files -n python3-%{name}
%files -n python3-%{name} -f %{pyproject_files}
%if %{with docs}
%doc CHANGELOG.html
%doc README.html
%doc CONTRIBUTING.html
%doc _htmldocs/html
%endif
%license LICENSE
%{_bindir}/pytest
%{_bindir}/pytest-3
%{_bindir}/pytest-%{python3_version}
%{_bindir}/py.test
%{_bindir}/py.test-3
%{_bindir}/py.test-%{python3_version}
%{python3_sitelib}/pytest-*.egg-info/
%{python3_sitelib}/_pytest/
%{python3_sitelib}/pytest/
%changelog
* Tue Feb 22 2022 Tomas Orsava <torsava@redhat.com> - 6.2.2-6
- Add gating configuration and a simple smoke test
- Related: rhbz#1950291
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 7.4.3-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 7.4.3-4
- Rebuilt for MSVSphere 10
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 7.4.3-4
- Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 7.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 7.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Nov 09 2023 Miro Hrončok <mhroncok@redhat.com> - 7.4.3-1
- Update to 7.4.3
- Changelog: https://docs.pytest.org/en/stable/changelog.html#pytest-7-4-3-2023-10-24
- Fixes: rhbz#2245983
* Fri Sep 08 2023 Miro Hrončok <mhroncok@redhat.com> - 7.4.2-1
- Update to 7.4.2
- Changelog: https://docs.pytest.org/en/stable/changelog.html#pytest-7-4-2-2023-09-07
- Fixes: rhbz#2237942
* Wed Sep 06 2023 Miro Hrončok <mhroncok@redhat.com> - 7.4.1-1
- Update to 7.4.1
- Changelog: https://docs.pytest.org/en/stable/changelog.html#pytest-7-4-1-2023-09-02
- Fixes: rhbz#2236995
* Mon Aug 07 2023 Lumír Balhar <lbalhar@redhat.com> - 7.4.0-1
- Update to 7.4.0
Resolves: rhbz#2216956
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 7.3.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 29 2023 Python Maint <python-maint@redhat.com> - 7.3.2-3
- Rebuilt for Python 3.12
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 7.3.2-2
- Bootstrap for Python 3.12
* Mon Jun 12 2023 Maxwell G <maxwell@gtmx.me> - 7.3.2-1
- Update to 7.3.2. Fixes rhbz#2213992.
* Mon Apr 24 2023 Miro Hrončok <mhroncok@redhat.com> - 7.3.1-2
- Fix build with setuptools >= 67.5.0
- Fixes: rhbz#2188982
* Mon Apr 17 2023 Miro Hrončok <mhroncok@redhat.com> - 7.3.1-1
- Update to 7.3.1
- Changelog: https://docs.pytest.org/en/stable/changelog.html#pytest-7-3-1-2023-04-14
- Fixes: rhbz#2186895
* Sun Apr 09 2023 Miro Hrončok <mhroncok@redhat.com> - 7.3.0-1
- Update to 7.3.0
- Changelog: https://docs.pytest.org/en/stable/changelog.html#pytest-7-3-0-2023-04-08
- Fixes: rhbz#2185393
* Fri Mar 24 2023 Miro Hrončok <mhroncok@redhat.com> - 7.2.2-1
- Update to 7.2.2
- Changelog: https://docs.pytest.org/en/7.2.x/changelog.html#pytest-7-2-2-2023-03-03
- Fixes: rhbz#2175310
* Fri Feb 10 2023 Stephen Gallagher <sgallagh@redhat.com> - 7.2.1-2
- Don't build tests and docs on RHEL to reduce dependencies
* Fri Jan 27 2023 Miro Hrončok <mhroncok@redhat.com> - 7.2.1-1
- Update to 7.2.1
- Fixes: rhbz#2160925
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 7.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Dec 10 2022 Miro Hrončok <mhroncok@redhat.com> - 7.2.0-2
- Remove -s from Python shebang,
ensure that packages installed with pip to user locations are testable
- Fixes: rhbz#2152171
* Tue Nov 01 2022 Lumír Balhar <lbalhar@redhat.com> - 7.2.0-1
- Update to 7.2.0
Resolves: rhbz#2137514
* 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
* Wed Jul 13 2022 Miro Hrončok <mhroncok@redhat.com> - 7.1.2-4
- Adjust tests for a last minute Python 3.11 change in the traceback format
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 7.1.2-3
- Rebuilt for Python 3.11
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 7.1.2-2
- Bootstrap for Python 3.11
* Fri Apr 08 2022 Lumír Balhar <lbalhar@redhat.com> - 7.1.2-1
- Update to 7.1.2
Resolves: rhbz#2063549
* Tue Mar 01 2022 Miro Hrončok <mhroncok@redhat.com> - 7.0.1-1
- Update to 7.0.1
- Fixes: rhbz#2050629
* Fri Jan 21 2022 Miro Hrončok <mhroncok@redhat.com> - 7.0.0~rc1-1
- Update to 7.0.0rc1
- Fixes: rhbz#2029764
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Sep 15 2021 Charalampos Stratakis <cstratak@redhat.com> - 6.2.5-1
- Update to 6.2.5
- Fixes: rhbz#1999270
* Fri Aug 27 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.4-7
- Enable all tests during package build
* Fri Aug 27 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.4-6
- Allow pluggy >=1.0
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Jul 12 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.4-4
- Adjust pytest's own tests for changes in Python 3.10.0b4
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 6.2.4-3
- Rebuilt for Python 3.10
* Tue Feb 08 2022 Tomas Orsava <torsava@redhat.com> - 6.2.2-5
- Add automatically generated Obsoletes tag with the python39- prefix
for smoother upgrade from RHEL8
- Related: rhbz#1990421
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 6.2.4-2
- Bootstrap for Python 3.10
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 6.2.2-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue May 04 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.4-1
- Update to 6.2.4
- Fixes: rhbz#1956942
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.2.2-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Apr 12 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.3-1
- Update to 6.2.3
- Fixes: rhbz#1946061
* Wed Mar 10 2021 Charalampos Stratakis <cstratak@redhat.com> - 6.2.2-2
- Disable tests and documentation generation on RHEL9 to avoid pulling in dependencies
* Wed Mar 10 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.2-2
- Drop redundant build dependency on wcwidth (unused since 6.0.0rc1)
* Wed Jan 27 2021 Miro Hrončok <mhroncok@redhat.com> - 6.2.2-1

Loading…
Cancel
Save