@ -1,5 +1,9 @@
%global srcname betamax
%global srcname betamax
# tests need internet access therefore disabled by default
# $ fedpkg mockbuild --enable-network --with=tests
%bcond_with tests
Name: python-%{srcname}
Name: python-%{srcname}
Version: 0.8.1
Version: 0.8.1
Release: 9%{?dist}
Release: 9%{?dist}
@ -22,8 +26,10 @@ Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
%{?python_provide:%python_provide python3-%{srcname}}
BuildRequires: python3-devel
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools
BuildRequires: python3-requests >= 2.0
%if %{with tests}
BuildRequires: python3-pytest
BuildRequires: python3-pytest
BuildRequires: python3-requests >= 2.0
%endif
Requires: python3-requests >= 2.0
Requires: python3-requests >= 2.0
%description -n python3-%{srcname} %{_description}
%description -n python3-%{srcname} %{_description}
@ -39,9 +45,14 @@ Python 3 version.
%install
%install
%py3_install
%py3_install
# disable tests as they need n/w access
%check
#%check
%if %{with tests}
#%{__python3} setup.py test
# 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}
%files -n python3-%{srcname}
%doc README.rst
%doc README.rst