Disable tests by default in RHEL builds
RHEL does not include pytest-mock or requests-mock, without which the tests cannot be run.
This commit is contained in:
parent
b8b89323ec
commit
7c520e28b2
@ -1,3 +1,6 @@
|
|||||||
|
# RHEL does not include the test dependencies
|
||||||
|
%bcond tests %{undefined rhel}
|
||||||
|
|
||||||
%global distname requests-oauthlib
|
%global distname requests-oauthlib
|
||||||
%global modname requests_oauthlib
|
%global modname requests_oauthlib
|
||||||
|
|
||||||
@ -25,9 +28,11 @@ BuildRequires: python3-setuptools
|
|||||||
BuildRequires: python3-oauthlib >= 0.6.2
|
BuildRequires: python3-oauthlib >= 0.6.2
|
||||||
BuildRequires: python3-requests >= 2.0.0
|
BuildRequires: python3-requests >= 2.0.0
|
||||||
|
|
||||||
|
%if %{with tests}
|
||||||
BuildRequires: python3-pytest
|
BuildRequires: python3-pytest
|
||||||
BuildRequires: python3-pytest-mock
|
BuildRequires: python3-pytest-mock
|
||||||
BuildRequires: python3-requests-mock
|
BuildRequires: python3-requests-mock
|
||||||
|
%endif
|
||||||
|
|
||||||
Requires: python3-oauthlib
|
Requires: python3-oauthlib
|
||||||
Requires: python3-requests
|
Requires: python3-requests
|
||||||
@ -49,7 +54,11 @@ rm -rf %{distname}.egg-info
|
|||||||
%py3_install
|
%py3_install
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
%if %{with tests}
|
||||||
%pytest -k "not testCanPostBinaryData and not test_content_type_override and not test_url_is_native_str"
|
%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}
|
%files -n python3-%{distname}
|
||||||
%doc README.rst HISTORY.rst requirements.txt AUTHORS.rst
|
%doc README.rst HISTORY.rst requirements.txt AUTHORS.rst
|
||||||
|
Loading…
Reference in New Issue
Block a user