python-pytest/python-pytest.spec

113 lines
3.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-pytest
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# NOTE(saschpe): git invocation and pythonpath issues with testrepository
# enable testing with a build conditional (off by default):
%bcond_with test
Name: python-pytest
Version: 2.8.7
Release: 0
Summary: Simple powerful testing with Python
License: MIT
Group: Development/Languages/Python
Url: http://pytest.org
Source: http://pypi.python.org/packages/source/p/pytest/pytest-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-py >= 1.4.25
BuildRequires: python-setuptools
BuildRequires: unzip
# Test requirements:
BuildRequires: lsof
%if %{with test}
BuildRequires: python-mock
BuildRequires: python-pexpect
%endif
BuildRequires: python-xml
BuildRequires: python-PyYAML
Requires: python-py >= 1.4.25
Requires(post): update-alternatives
Requires(postun): update-alternatives
#/usr/bin/py.test imports pkg_resources
Requires: python-setuptools
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
Requires: python-argparse
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
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.
%prep
%setup -q -n pytest-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
rm %{buildroot}%{_bindir}/py.test
ln -s %{_bindir}/py.test-%{py_ver} %{buildroot}%{_bindir}/py.test
%if %{with test} && 0%{?suse_version} > 1110
%check
python setup.py test
%endif
%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:
[ -h %{_bindir}/py.test ] || rm -f %{_bindir}/py.test
%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
%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
Accepting request 212740 from devel:languages:python - Update to 2.5.1: + merge new documentation styling PR from Tobias Bieniek. + fix issue403: allow parametrize of multiple same-name functions within a collection node. + Allow parameterized fixtures to specify the ID of the parameters by adding an ids argument to pytest.fixture() and pytest.yield_fixture(). + fix issue404 by always using the binary xml escape in the junitxml plugin. + fix issue407: fix addoption docstring to point to argparse instead of optparse. * 2.5.0: + dropped python2.5 from automated release testing of pytest itself which means it's probably going to break soon + simplified and fixed implementation for calling finalizers when parametrized fixtures or function arguments are involved. finalization is now performed lazily at setup time instead of in the "teardown phase". + PR90: add --color=yes|no|auto option to force terminal coloring mode ("auto" is default). + fix issue319 - correctly show unicode in assertion errors. Also means we depend on py>=1.4.19 now. + fix issue396 - correctly sort and finalize class-scoped parametrized tests independently from number of methods on the class. + refix issue323 in a better way -- parametrization should now never cause Runtime Recursion errors because the underlying algorithm for re-ordering tests per-scope/per-fixture is not recursive anymore + fix issue290 - there is preliminary support now for parametrizing with repeated same values (sometimes useful to to test if calling a second time works as with the first time). + close issue240 - document precisely how pytest module importing (forwarded request 212738 from mvyskocil) OBS-URL: https://build.opensuse.org/request/show/212740 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest?expand=0&rev=9
2014-01-07 16:27:10 +01:00
%if 0%{?suse_version} >= 1230
%ghost %{_sysconfdir}/alternatives/py.test
%endif
%ghost %{_bindir}/py.test
%{_bindir}/py.test-%{py_ver}
%{python_sitelib}/*
%changelog