From 3c9479145e7362d4aa7cc266822efda0220ef0d6 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Jul 15 2020 11:00:20 +0000 Subject: faker integration only works on Fedora 33+ The faker pytest integration was added in faker 4.1. --- diff --git a/python-pytest-randomly.spec b/python-pytest-randomly.spec index 9da017b..89fdce3 100644 --- a/python-pytest-randomly.spec +++ b/python-pytest-randomly.spec @@ -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 - 3.4.1-2 +- skip tests for optional faker integration when it is not available + * Wed Jul 15 2020 Dan Callaghan - 3.4.1-1 - new upstream release 3.4.1: https://github.com/pytest-dev/pytest-randomly/blob/3.4.1/HISTORY.rst