From d2ba833e155088f8e0643d22babcbc123f8210a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 14 May 2018 14:07:52 +0200 Subject: [PATCH] Conditionalize the tests, useful when bootstrapping Python --- python-urllib3.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python-urllib3.spec b/python-urllib3.spec index 10dc210..dd6801d 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -1,5 +1,8 @@ %global srcname urllib3 +# When bootstrapping Python, we cannot test this yet +%bcond_without tests + Name: python-%{srcname} Version: 1.22 Release: 9%{?dist} @@ -34,7 +37,7 @@ Requires: python2-ipaddress Requires: python2-pysocks BuildRequires: python2-devel -# For unittests +%if %{with tests} BuildRequires: python2-nose BuildRequires: python2-nose-exclude BuildRequires: python2-coverage @@ -44,6 +47,7 @@ BuildRequires: python2-psutil BuildRequires: python2-pysocks BuildRequires: python2-pytest BuildRequires: python2-tornado +%endif %description -n python2-%{srcname} Python2 HTTP module with connection pooling and file POST abilities. @@ -53,7 +57,7 @@ Python2 HTTP module with connection pooling and file POST abilities. Summary: Python3 HTTP library with thread-safe connection pooling and file post BuildRequires: python3-devel -# For unittests +%if %{with tests} BuildRequires: python3-nose BuildRequires: python3-mock BuildRequires: python3-six @@ -61,6 +65,7 @@ BuildRequires: python3-pysocks BuildRequires: python3-psutil BuildRequires: python3-pytest BuildRequires: python3-tornado +%endif Requires: ca-certificates Requires: python3-six @@ -118,9 +123,11 @@ ln -s ../../../__pycache__/six.cpython-%{python3_version_nodots}.pyc %{buildroot cp %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py +%if %{with tests} %check py.test py.test-3 +%endif %files -n python2-%{srcname}