ability to run tests in %check

Currently the tests require a live internet connection until upstream
issue 145 [1] is fixed.

Also some tests are failing due to changed endpoints and other (unknown)
reasons. Still I think it is useful to be able to run at least some
tests manually.

[1] https://github.com/betamaxpy/betamax/issues/145
epel9
Felix Schwarz 5 years ago
parent 969afed243
commit 830ee56edc

@ -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

Loading…
Cancel
Save