faker integration only works on Fedora 33+

The faker pytest integration was added in faker 4.1.
epel9
Dan Callaghan 5 years ago
parent eb9532b332
commit 3c9479145e

@ -3,7 +3,7 @@
Name: python-%{upstream_name}
Version: 3.4.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Pytest plugin to randomly order tests and control random.seed
License: BSD
URL: https://github.com/pytest-dev/pytest-randomly
@ -30,6 +30,9 @@ Requires: python3-importlib-metadata
BuildRequires: python3-pytest
BuildRequires: python3-pytest-xdist
BuildRequires: python3-factory-boy
%if 0%{?fedora} >= 33
BuildRequires: python3-faker
%endif
BuildRequires: python3-numpy
%description -n python3-%{upstream_name}
@ -46,7 +49,13 @@ rm -r src/*.egg-info
%py3_install
%check
%if 0%{?fedora} >= 33
PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -p no:randomly -v tests/
%else
# Faker pytest integration is only in Fedora 33+
# so skip tests for it when it is not available
PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -p no:randomly -v tests/ -k 'not faker'
%endif
%files -n python3-%{upstream_name}
%doc README.rst HISTORY.rst
@ -56,6 +65,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest-3 -p
%{python3_sitelib}/%{module_name}*.egg-info
%changelog
* Wed Jul 15 2020 Dan Callaghan <djc@djc.id.au> - 3.4.1-2
- skip tests for optional faker integration when it is not available
* Wed Jul 15 2020 Dan Callaghan <djc@djc.id.au> - 3.4.1-1
- new upstream release 3.4.1:
https://github.com/pytest-dev/pytest-randomly/blob/3.4.1/HISTORY.rst

Loading…
Cancel
Save