diff --git a/python-betamax.spec b/python-betamax.spec index dc19ea6..c8067ff 100644 --- a/python-betamax.spec +++ b/python-betamax.spec @@ -1,5 +1,9 @@ %global srcname betamax +# tests need internet access therefore disabled by default +# $ fedpkg mockbuild --enable-network --with=tests +%bcond_with tests + Name: python-%{srcname} Version: 0.8.1 Release: 9%{?dist} @@ -22,8 +26,10 @@ Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: python3-requests >= 2.0 +%if %{with tests} BuildRequires: python3-pytest +BuildRequires: python3-requests >= 2.0 +%endif Requires: python3-requests >= 2.0 %description -n python3-%{srcname} %{_description} @@ -39,9 +45,14 @@ Python 3 version. %install %py3_install -# disable tests as they need n/w access -#%check -#%{__python3} setup.py test +%check +%if %{with tests} +# test_pytest_fixture: not sure why it fails but better run some tests than none +# test_replays_response_from_cassette: https://github.com/betamaxpy/betamax/issues/184 +# TestPyTestParametrizedFixtures: failure reason unknown +TEST_SELECTOR="not test_fixtures and not test_replays_response_from_cassette and not TestPyTestParametrizedFixtures" +py.test-%{python3_version} -vk "$TEST_SELECTOR" +%endif %files -n python3-%{srcname} %doc README.rst