From 7c520e28b23bb51376475133560601491911ed7b Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 30 May 2023 08:18:42 -0400 Subject: [PATCH] Disable tests by default in RHEL builds RHEL does not include pytest-mock or requests-mock, without which the tests cannot be run. --- python-requests-oauthlib.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python-requests-oauthlib.spec b/python-requests-oauthlib.spec index 18211d2..6fc1eda 100644 --- a/python-requests-oauthlib.spec +++ b/python-requests-oauthlib.spec @@ -1,3 +1,6 @@ +# RHEL does not include the test dependencies +%bcond tests %{undefined rhel} + %global distname requests-oauthlib %global modname requests_oauthlib @@ -25,9 +28,11 @@ BuildRequires: python3-setuptools BuildRequires: python3-oauthlib >= 0.6.2 BuildRequires: python3-requests >= 2.0.0 +%if %{with tests} BuildRequires: python3-pytest BuildRequires: python3-pytest-mock BuildRequires: python3-requests-mock +%endif Requires: python3-oauthlib Requires: python3-requests @@ -49,7 +54,11 @@ rm -rf %{distname}.egg-info %py3_install %check +%if %{with tests} %pytest -k "not testCanPostBinaryData and not test_content_type_override and not test_url_is_native_str" +%else +%py3_check_import %{modname} +%endif %files -n python3-%{distname} %doc README.rst HISTORY.rst requirements.txt AUTHORS.rst