3 %bcond_without tests # py.test tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module pytest-timeout
8 Summary: py.test plugin to abort hanging tests
9 Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: https://pypi.python.org/packages/cc/b7/b2a61365ea6b6d2e8881360ae7ed8dad0327ad2df89f2f0be4a02304deb2/pytest-timeout-%{version}.tar.gz
16 # Source0-md5: 83607d91aa163562c7ee835da57d061d
17 URL: http://bitbucket.org/pytest-dev/pytest-timeout/
19 BuildRequires: python-modules >= 1:2.6
20 BuildRequires: python-setuptools
22 BuildRequires: python-pexpect
23 BuildRequires: python-pytest >= 2.8.0
27 BuildRequires: python3-modules >= 1:3.3
28 BuildRequires: python3-setuptools
30 BuildRequires: python3-pexpect
31 BuildRequires: python3-pytest >= 2.8.0
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.714
36 Requires: python-modules >= 1:2.6
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 This is a plugin which will terminate tests after a certain timeout.
42 When doing so it will show a stack dump of all threads running at the
43 time. This is useful when running tests under a continuous integration
44 server or simply if you don't know why the test suite hangs.
46 %description -l pl.UTF-8
47 Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy
48 tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili.
49 Jest to przydatne przy uruchamianiu testów na serwerze ciągłej
50 integracji lub jeśli nie wiemy, dlaczego testy się zawieszają.
52 %package -n python3-%{module}
53 Summary: py.test plugin to abort hanging tests
54 Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów
55 Group: Libraries/Python
56 Requires: python3-modules >= 1:3.3
58 %description -n python3-%{module}
59 This is a plugin which will terminate tests after a certain timeout.
60 When doing so it will show a stack dump of all threads running at the
61 time. This is useful when running tests under a continuous integration
62 server or simply if you don't know why the test suite hangs.
64 %description -n python3-%{module} -l pl.UTF-8
65 Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy
66 tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili.
67 Jest to przydatne przy uruchamianiu testów na serwerze ciągłej
68 integracji lub jeśli nie wiemy, dlaczego testy się zawieszają.
71 %setup -q -n %{module}-%{version}
77 %{?with_tests:PYTHONPATH=$(pwd) %{__python} -m pytest}
83 %{?with_tests:PYTHONPATH=$(pwd) %{__python3} -m pytest}
87 rm -rf $RPM_BUILD_ROOT
99 rm -rf $RPM_BUILD_ROOT
103 %defattr(644,root,root,755)
105 %{py_sitescriptdir}/pytest_timeout.py[co]
106 %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info
110 %files -n python3-%{module}
111 %defattr(644,root,root,755)
113 %{py3_sitescriptdir}/pytest_timeout.py
114 %{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co]
115 %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info