# # Conditional build: %bcond_with tests # py.test tests [use ptys, so not on builders] %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %define module pytest-timeout Summary: py.test plugin to abort hanging tests Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów Name: python-%{module} Version: 1.2.0 Release: 1 License: MIT Group: Libraries/Python Source0: https://pypi.python.org/packages/cc/b7/b2a61365ea6b6d2e8881360ae7ed8dad0327ad2df89f2f0be4a02304deb2/pytest-timeout-%{version}.tar.gz # Source0-md5: 83607d91aa163562c7ee835da57d061d URL: http://bitbucket.org/pytest-dev/pytest-timeout/ %if %{with python2} BuildRequires: python-modules >= 1:2.6 BuildRequires: python-setuptools %if %{with tests} BuildRequires: python-pexpect BuildRequires: python-pytest >= 2.8.0 %endif %endif %if %{with python3} BuildRequires: python3-modules >= 1:3.3 BuildRequires: python3-setuptools %if %{with tests} BuildRequires: python3-pexpect BuildRequires: python3-pytest >= 2.8.0 %endif %endif BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 Requires: python-modules >= 1:2.6 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description This is a plugin which will terminate tests after a certain timeout. When doing so it will show a stack dump of all threads running at the time. This is useful when running tests under a continuous integration server or simply if you don't know why the test suite hangs. %description -l pl.UTF-8 Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili. Jest to przydatne przy uruchamianiu testów na serwerze ciągłej integracji lub jeśli nie wiemy, dlaczego testy się zawieszają. %package -n python3-%{module} Summary: py.test plugin to abort hanging tests Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów Group: Libraries/Python Requires: python3-modules >= 1:3.3 %description -n python3-%{module} This is a plugin which will terminate tests after a certain timeout. When doing so it will show a stack dump of all threads running at the time. This is useful when running tests under a continuous integration server or simply if you don't know why the test suite hangs. %description -n python3-%{module} -l pl.UTF-8 Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili. Jest to przydatne przy uruchamianiu testów na serwerze ciągłej integracji lub jeśli nie wiemy, dlaczego testy się zawieszają. %prep %setup -q -n %{module}-%{version} %build %if %{with python2} %py_build %{?with_tests:PYTHONPATH=$(pwd) %{__python} -m pytest} %endif %if %{with python3} %py3_build %{?with_tests:PYTHONPATH=$(pwd) %{__python3} -m pytest} %endif %install rm -rf $RPM_BUILD_ROOT %if %{with python2} %py_install %py_postclean %endif %if %{with python3} %py3_install %endif %clean rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) %doc LICENSE README %{py_sitescriptdir}/pytest_timeout.py[co] %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) %doc LICENSE README %{py3_sitescriptdir}/pytest_timeout.py %{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co] %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info %endif