Compare commits

...

No commits in common. "imports/c8-beta-stream-2.7/pytest-3.4.2-13.module+el8.1.0+3111+de3f2d8e" and "c8-stream-3.8" have entirely different histories.

4 changed files with 261 additions and 143 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/pytest-3.4.2.tar.gz
SOURCES/pytest-4.6.6.tar.gz

View File

@ -1 +1 @@
1194854795c65e29a1038da50fe5f5230f964360 SOURCES/pytest-3.4.2.tar.gz
6b2e5766b509e9351c457f3d48c665a8e6842e87 SOURCES/pytest-4.6.6.tar.gz

View File

@ -0,0 +1,69 @@
From 5276d4e2b23dcefeb0cba419926c9006859d9011 Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Mon, 2 Dec 2019 13:55:11 +0100
Subject: [PATCH] Disable test with hypothesis when it's not available
---
testing/python/metafunc.py | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py
index d907878..c79d780 100644
--- a/testing/python/metafunc.py
+++ b/testing/python/metafunc.py
@@ -4,9 +4,8 @@ import sys
import textwrap
import attr
-import hypothesis
+
import six
-from hypothesis import strategies
import pytest
from _pytest import fixtures
@@ -15,6 +14,13 @@ from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG
PY3 = sys.version_info >= (3, 0)
+try:
+ from hypothesis import strategies
+ import hypothesis
+except ImportError:
+ with_hypothesis = False
+else:
+ with_hypothesis = True
class TestMetafunc(object):
def Metafunc(self, func, config=None):
@@ -196,16 +202,17 @@ class TestMetafunc(object):
assert metafunc._calls[2].id == "x1-a"
assert metafunc._calls[3].id == "x1-b"
- @hypothesis.given(strategies.text() | strategies.binary())
- @hypothesis.settings(
- deadline=400.0
- ) # very close to std deadline and CI boxes are not reliable in CPU power
- def test_idval_hypothesis(self, value):
- from _pytest.python import _idval
-
- escaped = _idval(value, "a", 6, None, item=None, config=None)
- assert isinstance(escaped, six.text_type)
- escaped.encode("ascii")
+ if with_hypothesis:
+ @hypothesis.given(strategies.text() | strategies.binary())
+ @hypothesis.settings(
+ deadline=400.0
+ ) # very close to std deadline and CI boxes are not reliable in CPU power
+ def test_idval_hypothesis(self, value):
+ from _pytest.python import _idval
+
+ escaped = _idval(value, "a", 6, None, item=None, config=None)
+ assert isinstance(escaped, six.text_type)
+ escaped.encode("ascii")
def test_unicode_idval(self):
"""This tests that Unicode strings outside the ASCII character set get
--
2.23.0

View File

@ -1,205 +1,254 @@
%bcond_without python3
%global pylib_version 1.4.29
Name: pytest
Version: 3.4.2
Release: 13%{?dist}
Version: 4.6.6
Release: 3%{?dist}
Summary: Simple powerful testing with Python
License: MIT
URL: http://pytest.org
Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
URL: https://pytest.org
Source0: %{pypi_source}
Patch0: Disable-test-with-hypothesis-when-it-s-not-available.patch
# The tests in this specfile use pytest-timeout
# The test in this specfile use pytest-timeout
# When building pytest for the first time with new Python version
# that is not possible as it depends on pytest.
# It's also not possible on systems that don't build pytest-timeout at all.
# that is not possible as it depends on pytest
%bcond_with timeout
# When building pytest for the first time with new Python version
# we might not yet have all the BRs, this allows us to build without some that
# are likely not yet built.
# Pytest will skip the related tests, so we only conditionalize the BRs
%bcond_with optional_tests
# When building pytest for the first time with new Python version
# we also don't have sphinx yet and cannot build docs.
%bcond_with docs
%if %{with docs}
BuildRequires: %{_bindir}/rst2html
BuildRequires: python%{python3_pkgversion}-pygments-pytest
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-sphinx-removed-in
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-trio
BuildRequires: make
%endif
BuildArch: noarch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
%description
py.test provides simple, yet powerful testing for Python.
%package -n python2-%{name}
%package -n python%{python3_pkgversion}-%{name}
Summary: Simple powerful testing with Python
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-setuptools_scm
BuildRequires: python2-py >= %{pylib_version}
BuildRequires: python2-attrs
BuildRequires: python%{python3_pkgversion}-atomicwrites
BuildRequires: python%{python3_pkgversion}-attrs
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-more-itertools
BuildRequires: python%{python3_pkgversion}-packaging
BuildRequires: python%{python3_pkgversion}-pluggy >= 0.12
BuildRequires: python%{python3_pkgversion}-py >= 1.5.0
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-six
BuildRequires: python%{python3_pkgversion}-wcwidth
BuildRequires: python%{python3_pkgversion}-rpm-macros
%if %{with timeout}
BuildRequires: python2-pytest-timeout
BuildRequires: python%{python3_pkgversion}-pytest-timeout
%endif
BuildRequires: python2-pluggy
BuildRequires: python2-funcsigs
BuildRequires: python2-six
Requires: python2-attrs
Requires: python2-funcsigs
Requires: python2-pluggy
Requires: python2-six
Requires: python2-setuptools
Requires: python2-py >= %{pylib_version}
%{?python_provide:%python_provide python2-%{name}}
Obsoletes: %{name} < 2.8.7-3
%description -n python2-%{name}
%if %{with optional_tests}
BuildRequires: python%{python3_pkgversion}-argcomplete
BuildRequires: python%{python3_pkgversion}-decorator
BuildRequires: python%{python3_pkgversion}-jinja2
BuildRequires: python%{python3_pkgversion}-nose
BuildRequires: python%{python3_pkgversion}-twisted
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
Requires: python%{python3_pkgversion}-atomicwrites
Requires: python%{python3_pkgversion}-attrs
Requires: python%{python3_pkgversion}-more-itertools
Requires: python%{python3_pkgversion}-packaging
Requires: python%{python3_pkgversion}-pluggy >= 0.12
Requires: python%{python3_pkgversion}-py >= 1.5.0
Requires: python%{python3_pkgversion}-setuptools
Requires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-wcwidth
%description -n python%{python3_pkgversion}-%{name}
py.test provides simple, yet powerful testing for Python.
%if %{with python3}
%package -n python3-%{name}
Summary: Simple powerful testing with Python
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
BuildRequires: python3-py >= %{pylib_version}
BuildRequires: python3-hypothesis
BuildRequires: python3-attrs
%if %{with timeout}
BuildRequires: python3-pytest-timeout
%endif
BuildRequires: python3-pluggy
BuildRequires: python3-six
Requires: python3-attrs
Requires: python3-pluggy
Requires: python3-six
Requires: python3-setuptools
Requires: python3-py >= %{pylib_version}
%{?python_provide:%python_provide python3-%{name}}
Obsoletes: platform-python-%{name} < %{version}-%{release}
%description -n python3-%{name}
py.test provides simple, yet powerful testing for Python.
%endif
%prep
%autosetup
%autosetup -p1
# Remove dependency of setuptools-scm
sed -i "/ *use_scm_version=.*,/d" setup.py
sed -i "s/ *setup_requires=.*/version='%{version}',/" setup.py
%build
%py2_build
%if %{with python3}
%py3_build
%if %{with docs}
for l in doc/* ; do
make -C $l html PYTHONPATH=$(pwd)/src SPHINXBUILD=%{_bindir}/sphinx-build-3
done
for f in README CHANGELOG CONTRIBUTING ; do
rst2html ${f}.rst > ${f}.html
done
%endif
%install
%py2_install
mv %{buildroot}%{_bindir}/pytest %{buildroot}%{_bindir}/pytest-%{python2_version}
ln -snf pytest-%{python2_version} %{buildroot}%{_bindir}/pytest-2
mv %{buildroot}%{_bindir}/py.test %{buildroot}%{_bindir}/py.test-%{python2_version}
ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test-2
%if %{with python3}
%py3_install
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}
ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test-3
%if %{with docs}
mkdir -p _htmldocs/html
for l in doc/* ; do
# remove hidden file
rm ${l}/_build/html/.buildinfo
mv ${l}/_build/html _htmldocs/html/${l##doc/}
done
%endif
# remove shebangs from all scripts - python 2
find %{buildroot}%{python2_sitelib} \
-name '*.py' \
-exec sed -i -e '1{/^#!/d}' {} \;
%if %{with python3}
# remove shebangs from all scripts - python 3
# remove shebangs from all scripts
find %{buildroot}%{python3_sitelib} \
-name '*.py' \
-exec sed -i -e '1{/^#!/d}' {} \;
%endif
%check
PATH=%{buildroot}%{_bindir}:${PATH} \
# Skip "metafunc" tests, since these require pythyon2-hypothesis
PYTHONPATH=%{buildroot}%{python2_sitelib} \
%{buildroot}%{_bindir}/pytest-%{python2_version} -r s testing \
-k 'not non_ascii_paste_text' \
--ignore 'testing/python/metafunc.py' \
%if %{with timeout}
--timeout=30
%endif
%if %{with python3}
PYTHONDONTWRITEBYTECODE=1 \
PATH=%{buildroot}%{_bindir}:${PATH} \
PYTHONPATH=%{buildroot}%{python3_sitelib} \
%{buildroot}%{_bindir}/pytest-%{python3_version} -r s testing \
-k 'not non_ascii_paste_text' \
%if %{with timeout}
--timeout=30
%endif
%files -n python%{python3_pkgversion}-%{name}
%if %{with docs}
%doc CHANGELOG.html
%doc README.html
%doc CONTRIBUTING.html
%doc _htmldocs/html
%endif
%files -n python2-%{name}
%doc CHANGELOG.rst
%doc README.rst
%doc CONTRIBUTING.rst
%license LICENSE
%{_bindir}/pytest-2
%{_bindir}/pytest-%{python2_version}
%{_bindir}/py.test-2
%{_bindir}/py.test-%{python2_version}
%{python2_sitelib}/pytest-*.egg-info/
%{python2_sitelib}/_pytest/
%{python2_sitelib}/pytest.py*
%if %{with python3}
%files -n python3-%{name}
%doc CHANGELOG.rst
%doc README.rst
%doc CONTRIBUTING.rst
%license LICENSE
%{_bindir}/pytest-3
%{_bindir}/pytest-%{python3_version}
%{_bindir}/py.test-3
%{_bindir}/py.test-%{python3_version}
%{python3_sitelib}/pytest-*.egg-info/
%{python3_sitelib}/_pytest/
%{python3_sitelib}/pytest.py
%{python3_sitelib}/__pycache__/pytest.*
%endif
%changelog
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 3.4.2-13
- Bumping due to problems with modular RPM upgrade path
- Resolves: rhbz#1695587
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 4.6.6-3
- Exclude unsupported i686 arch
* Tue Oct 09 2018 Lumír Balhar <lbalhar@redhat.com> - 3.4.2-12
- Remove unversioned provides
- Resolves: rhbz#1628242
* Tue Nov 19 2019 Lumír Balhar <lbalhar@redhat.com> - 4.6.6-2
- Adjusted for Python 3.8 module in RHEL 8
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 3.4.2-11
- Remove unversioned binaries from python2 subpackage
- Resolves: rhbz#1613343
* Fri Oct 25 2019 Thomas Moschny <thomas.moschny@gmx.de> - 4.6.6-1
- Update to 4.6.6.
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 3.4.2-10
- Make possible to disable python3 subpackage
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.5-4
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Jul 13 2018 Lumír Balhar <lbalhar@redhat.com> - 3.4.2-9
- First version for python27 module
* Sat Aug 17 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.5-3
- Rebuilt for Python 3.8
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 3.4.2-8
- Allow Python 2 for build
see https://hurl.corp.redhat.com/rhel8-py2
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.5-2
- Bootstrap for Python 3.8
* Fri Jun 22 2018 Petr Viktorin <pviktori@redhat.com> - 3.4.2-7
- Remove BuildRequires on python2-hypothesis, a circular dependency
- Explicitly BuildRequire python-attrs
* Wed Aug 14 2019 Thomas Moschny <thomas.moschny@gmx.de> - 4.6.5-1
- Update to 4.6.5.
- Add missing BR on make.
* Tue Jun 19 2018 Petr Viktorin <pviktori@redhat.com> - 3.4.2-6
- Don't use timeout in tests
https://bugzilla.redhat.com/show_bug.cgi?id=1592940
- Add missing BuildRequires
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jun 07 2018 Petr Viktorin <pviktori@redhat.com> - 3.4.2-5
- Remove optional BuildRequires for %%check
https://bugzilla.redhat.com/show_bug.cgi?id=1588445
* Tue Jul 23 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.4-2
- Fix a bad conflict
* Mon May 28 2018 Petr Viktorin <pviktori@redhat.com> - 3.4.2-4
- Drop python2-argcomplete from BuildRequires
* Mon Jul 01 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.4-1
- Update to 4.6.4, move python2-pytest to its own source package
- Make /usr/bin/pytest and /usr/bin/py.test Python 3
* Mon May 28 2018 Petr Viktorin <pviktori@redhat.com> - 3.4.2-3
- Use python3-sphinx to build the documentation
- Skip the `non_ascii_paste_text` test, which needs internet access
* Fri Jun 21 2019 Petr Viktorin <pviktori@redhat.com> - 4.4.1-2
- Remove optional test dependencies for Python 2 entirely
* Tue Apr 16 2019 Thomas Moschny <thomas.moschny@gmx.de> - 4.4.1-1
- Update to 4.4.1 (see PR#9).
- Remove test dependencies on python2-hypothesis and python2-twisted (see PR#10).
* Sat Mar 16 2019 Miro Hrončok <mhroncok@redhat.com> - 4.3.1-1
- Update to 4.3.1
* Tue Mar 12 2019 Miro Hrončok <mhroncok@redhat.com> - 4.3.0-1
- Update to 4.3.0 and fix FTBFS (#1671167, #1687384)
* Mon Feb 18 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.9.3-3
- Enable python dependency generator
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Oct 31 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.9.3-1
- Update to 3.9.3.
* Tue Oct 23 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.9.2-1
- Update to 3.9.2.
* Wed Oct 17 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.9.1-1
- Update to 3.9.1.
* Tue Oct 16 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.8.2-3
- Add python2-pathlib2 runtime requirement (rhbz#1639718).
* Tue Oct 16 2018 Nils Philippsen <nils@redhat.com> - 3.8.2-2
- versionize pluggy dependencies
* Tue Oct 16 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.8.2-1
- Update to 3.8.2.
* Sat Sep 29 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.6.4-1
- Update to 3.6.4.
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jul 5 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.6.3-1
- Update to 3.6.3.
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.2-3
- Enable timeout
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.2-2
- Rebuilt for Python 3.7 (without timeout)
* Thu Jun 28 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.6.2-1
- Update to 3.6.2.
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.1-3
- Rebuilt for Python 3.7
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.1-2
- Bootstrap for Python 3.7
* Tue Jun 5 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.6.1-1
- Update to 3.6.1.
* Mon May 28 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.0-1
- Update to 3.6.0 (#1581692)
- Require and BuildRequire atomicwrites
* Sat May 19 2018 Thomas Moschny <thomas.moschny@gmx.de> - 3.5.1-1
- Update to 3.5.1.
- Build the documentation with Python3.
- Update requirements.
* Thu Mar 15 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.4.2-2
- Add Requires for required modules