2012-03-05 18:01:42 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-pytest
|
|
|
|
#
|
2016-02-16 09:27:13 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2012-03-05 18:01:42 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2013-04-23 11:39:08 +02:00
|
|
|
|
2012-03-05 18:01:42 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2015-10-19 22:47:20 +02:00
|
|
|
|
2015-08-07 00:20:39 +02:00
|
|
|
# NOTE(saschpe): git invocation and pythonpath issues with testrepository
|
|
|
|
# enable testing with a build conditional (off by default):
|
|
|
|
%bcond_with test
|
2013-05-13 15:26:53 +02:00
|
|
|
|
2012-03-05 18:01:42 +01:00
|
|
|
Name: python-pytest
|
2016-02-16 09:27:13 +01:00
|
|
|
Version: 2.8.7
|
2012-03-05 18:01:42 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Simple powerful testing with Python
|
2013-04-23 11:39:08 +02:00
|
|
|
License: MIT
|
2012-03-05 18:01:42 +01:00
|
|
|
Group: Development/Languages/Python
|
2013-04-23 11:39:08 +02:00
|
|
|
Url: http://pytest.org
|
2013-06-25 07:42:24 +02:00
|
|
|
Source: http://pypi.python.org/packages/source/p/pytest/pytest-%{version}.tar.gz
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-03-05 18:01:42 +01:00
|
|
|
BuildRequires: python-devel
|
2015-05-25 23:05:14 +02:00
|
|
|
BuildRequires: python-py >= 1.4.25
|
|
|
|
BuildRequires: python-setuptools
|
2015-07-16 17:13:54 +02:00
|
|
|
BuildRequires: unzip
|
2013-05-13 15:26:53 +02:00
|
|
|
# Test requirements:
|
2015-05-25 23:05:14 +02:00
|
|
|
BuildRequires: lsof
|
2015-08-07 00:20:39 +02:00
|
|
|
%if %{with test}
|
2015-05-25 23:05:14 +02:00
|
|
|
BuildRequires: python-mock
|
|
|
|
BuildRequires: python-pexpect
|
2015-08-07 00:20:39 +02:00
|
|
|
%endif
|
2015-07-16 17:13:54 +02:00
|
|
|
BuildRequires: python-xml
|
2016-02-16 09:27:13 +01:00
|
|
|
BuildRequires: python-PyYAML
|
2015-05-25 23:05:14 +02:00
|
|
|
Requires: python-py >= 1.4.25
|
2013-06-25 07:42:24 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2014-06-19 13:08:39 +02:00
|
|
|
#/usr/bin/py.test imports pkg_resources
|
|
|
|
Requires: python-setuptools
|
2012-03-05 18:01:42 +01:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
2014-01-30 17:44:56 +01:00
|
|
|
Requires: python-argparse
|
2012-03-05 18:01:42 +01:00
|
|
|
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
|
|
%else
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
2013-04-23 11:39:08 +02:00
|
|
|
pytest helps you write better programs. It is a a mature full-featured,
|
|
|
|
cross-project Python testing tool. It provides:
|
|
|
|
|
|
|
|
* auto-discovery of test modules and functions,
|
|
|
|
* detailed info on failing assert statements (no need to remember
|
|
|
|
self.assert* names),
|
|
|
|
* modular fixtures for managing small or parametrized long-lived test resources.
|
|
|
|
* multi-paradigm support: you can use py.test to run test suites based on
|
|
|
|
unittest (or trial), nose,
|
|
|
|
* single-source compatibility to Python2.4 all the way up to Python3.3,
|
|
|
|
PyPy-1.9 and Jython-2.5.1, and
|
|
|
|
* many external plugins.
|
|
|
|
|
2012-03-05 18:01:42 +01:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pytest-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
python setup.py build
|
|
|
|
|
|
|
|
%install
|
|
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
2013-06-25 07:42:24 +02:00
|
|
|
rm %{buildroot}%{_bindir}/py.test
|
|
|
|
ln -s %{_bindir}/py.test-%{py_ver} %{buildroot}%{_bindir}/py.test
|
2012-03-05 18:01:42 +01:00
|
|
|
|
2015-08-07 00:20:39 +02:00
|
|
|
%if %{with test} && 0%{?suse_version} > 1110
|
2013-05-13 15:26:53 +02:00
|
|
|
%check
|
|
|
|
python setup.py test
|
2013-09-27 18:02:27 +02:00
|
|
|
%endif
|
2012-03-05 18:01:42 +01:00
|
|
|
|
2013-06-25 07:42:24 +02:00
|
|
|
%pre
|
|
|
|
# Since /usr/bin/py.test became ghosted to be used
|
|
|
|
# with update-alternatives, we have to get rid of the old binary resulting from the
|
|
|
|
# non-update-alternativies-ified package:
|
2014-11-15 11:41:01 +01:00
|
|
|
[ -h %{_bindir}/py.test ] || rm -f %{_bindir}/py.test
|
2013-06-25 07:42:24 +02:00
|
|
|
|
|
|
|
%post
|
|
|
|
update-alternatives \
|
|
|
|
--install %{_bindir}/py.test py.test %{_bindir}/py.test-%{py_ver} 20
|
|
|
|
|
|
|
|
%preun
|
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
update-alternatives --remove py.test %{_bindir}/py.test-%{py_ver}
|
|
|
|
fi
|
|
|
|
|
2012-03-05 18:01:42 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2015-05-25 23:05:14 +02:00
|
|
|
%doc LICENSE README.rst
|
2014-01-07 16:27:10 +01:00
|
|
|
%if 0%{?suse_version} >= 1230
|
|
|
|
%ghost %{_sysconfdir}/alternatives/py.test
|
|
|
|
%endif
|
2013-06-25 07:42:24 +02:00
|
|
|
%ghost %{_bindir}/py.test
|
2013-05-13 15:26:53 +02:00
|
|
|
%{_bindir}/py.test-%{py_ver}
|
2012-03-05 18:01:42 +01:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%changelog
|