3 %bcond_with tests # py.test tests [use ptys, so not on builders]
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}
11 # keep 1.x here for python2/pytest<5 support
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/pytest-timeout/
17 Source0: https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-%{version}.tar.gz
18 # Source0-md5: 552cc293447b00f7a294ce7a1fb3839f
19 URL: https://github.com/pytest-dev/pytest-timeout
21 BuildRequires: python-modules >= 1:2.7
22 BuildRequires: python-setuptools
24 BuildRequires: python-pexpect
25 BuildRequires: python-pytest >= 3.6.0
29 BuildRequires: python3-modules >= 1:3.5
30 BuildRequires: python3-setuptools
32 BuildRequires: python3-pexpect
33 BuildRequires: python3-pytest >= 3.6.0
36 BuildRequires: rpm-pythonprov
37 BuildRequires: rpmbuild(macros) >= 1.714
38 Requires: python-modules >= 1:2.7
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 This is a plugin which will terminate tests after a certain timeout.
44 When doing so it will show a stack dump of all threads running at the
45 time. This is useful when running tests under a continuous integration
46 server or simply if you don't know why the test suite hangs.
48 %description -l pl.UTF-8
49 Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy
50 tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili.
51 Jest to przydatne przy uruchamianiu testów na serwerze ciągłej
52 integracji lub jeśli nie wiemy, dlaczego testy się zawieszają.
54 %package -n python3-%{module}
55 Summary: py.test plugin to abort hanging tests
56 Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów
57 Group: Libraries/Python
58 Requires: python3-modules >= 1:3.5
60 %description -n python3-%{module}
61 This is a plugin which will terminate tests after a certain timeout.
62 When doing so it will show a stack dump of all threads running at the
63 time. This is useful when running tests under a continuous integration
64 server or simply if you don't know why the test suite hangs.
66 %description -n python3-%{module} -l pl.UTF-8
67 Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy
68 tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili.
69 Jest to przydatne przy uruchamianiu testów na serwerze ciągłej
70 integracji lub jeśli nie wiemy, dlaczego testy się zawieszają.
73 %setup -q -n %{module}-%{version}
90 %{__python3} -m pytest
95 rm -rf $RPM_BUILD_ROOT
108 rm -rf $RPM_BUILD_ROOT
112 %defattr(644,root,root,755)
113 %doc LICENSE README.rst
114 %{py_sitescriptdir}/pytest_timeout.py[co]
115 %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info
119 %files -n python3-%{module}
120 %defattr(644,root,root,755)
121 %doc LICENSE README.rst
122 %{py3_sitescriptdir}/pytest_timeout.py
123 %{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co]
124 %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info