python-pytest/python-pytest.spec

154 lines
4.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-pytest
#
# Copyright (c) 2019 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.
Accepting request 636145 from home:mimi_vx:branches:devel:languages:python:pytest - update to 3.8.0 * Config.warn has been deprecated, it should be replaced by calls to the standard warnings.warn. * Node.warn now supports two signatures: + node.warn(PytestWarning("some message")): is now the recommended way to call this function. The warning instance must be a PytestWarning or subclass instance. + node.warn("CI", "some message"): this code/message form is now deprecated and should be converted to the warning instance form above. * RemovedInPytest4Warning and PytestExperimentalApiWarning are now part of the public API and should be accessed using pytest.RemovedInPytest4Warning and pytest.PytestExperimentalApiWarning. * @pytest.mark.filterwarnings second parameter is no longer regex-escaped, making it possible to actually use regular expressions to check the warning message. + Note: regex-escaping the match string was an implementation oversight that might break test suites which depend on the old behavior. * Internal pytest warnings are now issued using the standard warnings module, making it possible to use the standard warnings filters to manage those warnings. This introduces PytestWarning, PytestDeprecationWarning and RemovedInPytest4Warning warning types as part of the public API. * DeprecationWarning and PendingDeprecationWarning are now shown by default if no other warning filter is configured. This makes pytest more compliant with PEP-0506. See the docs for more info. * Warnings are now captured and displayed during test collection. * PYTEST_DISABLE_PLUGIN_AUTOLOAD environment variable disables plugin auto-loading when set. * Added the count option to console_output_style to enable displaying the progress as a count instead of a percentage. * Added support for ‘xfailed’ and ‘xpassed’ outcomes to the pytester.RunResult.assert_outcomes signature. OBS-URL: https://build.opensuse.org/request/show/636145 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=15
2018-09-17 11:46:23 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%else
%bcond_with test
%endif
%if %{with test}
Name: python-pytest-%{flavor}
%else
Name: python-pytest
%endif
Version: 3.10.1
Release: 0
2017-11-02 10:24:10 +01:00
Summary: Python testing tool with autodiscovery and detailed asserts
License: MIT
Group: Development/Languages/Python
Accepting request 618559 from devel:languages:python:pytest - update to 3.6.2 - add python-mock to buildrequires - fix test command - add python_mock.patch to use stdlib mock library on py3 - Update to version 3.6.0 + Features * Revamp the internals of the ``pytest.mark`` implementation with correct per node handling which fixes a number of long standing bugs caused by the old design. This introduces new ``Node.iter_markers(name)`` and ``Node.get_closest_mark(name)`` APIs. Users are **strongly encouraged** to read the `reasons for the revamp in the docs <https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration>`_, or jump over to details about `updating existing code to use the new APIs <https://docs.pytest.org/en/latest/mark.html#updating-code>`_. (`#3317 <https://github.com/pytest-dev/pytest/issues/3317>`_) * Now when ``@pytest.fixture`` is applied more than once to the same function a ``ValueError`` is raised. This buggy behavior would cause surprising problems and if was working for a test suite it was mostly by accident. (`#2334 <https://github.com/pytest-dev/pytest/issues/2334>`_) * Support for Python 3.7's builtin ``breakpoint()`` method, see `Using the builtin breakpoint function <https://docs.pytest.org/en/latest/usage.html#breakpoint-builtin>`_ for details. (`#3180 <https://github.com/pytest-dev/pytest/issues/3180>`_) * ``monkeypatch`` now supports a ``context()`` function which acts as a context manager which undoes all patching done within the ``with`` block. (`#3290 <https://github.com/pytest-dev/pytest/issues/3290>`_) * The ``--pdb`` option now causes KeyboardInterrupt to enter the debugger, instead of stopping the test session. On python 2.7, hitting CTRL+C again exits the debugger. On python 3.2 and higher, use CTRL+D. (`#3299 OBS-URL: https://build.opensuse.org/request/show/618559 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest?expand=0&rev=37
2018-06-25 11:35:39 +02:00
URL: https://github.com/pytest-dev/pytest
2017-11-02 10:24:10 +01:00
Source: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix_test_raises_exception_looks_iterable.patch gh#pytest-dev/pytest#4525 mcepl@suse.com
Patch0: fix_test_raises_exception_looks_iterable.patch
# PATCH-FIX-UPSTREAM taken from master
Patch1: new-pluggy.patch
Accepting request 644834 from home:mimi_vx:branches:devel:languages:python:pytest - update to 3.9.2 * Improve error message when a recursive dependency between fixtures is detected. * Fix logging messages not shown in hooks pytest_sessionstart() and pytest_sessionfinish(). * Fix unescaped XML raw objects in JUnit report for skipped tests * Python 2: safely format warning message about passing unicode strings to warnings.warn, which may cause surprising MemoryError exception when monkey patching warnings.warn itself. * Improve error message when it is not possible to determine a function’s signature. * Pin setuptools>=40.0 to support py_modules in setup.cfg * Restore the tmpdir behaviour of symlinking the current test run. * Fix filename reported by warnings.warn when using recwarn under python2. * For test-suites containing test classes, the information about the subclassed module is now output only if a higher verbosity level is specified (at least “-vv”). * The following accesses have been documented as deprecated for years, but are now actually emitting deprecation warnings. * Add a Deprecation warning for pytest.ensuretemp as it was deprecated since a while. * Improve usage errors messages by hiding internal details which can be distracting and noisy. This has the side effect that some error conditions that previously raised generic errors (such as ValueError for unregistered marks) are now raising Failed exceptions. * Log messages generated in the collection phase are shown when live-logging is enabled and/or when they are logged to a file. * Introduce tmp_path as a fixture providing a Path object. * Deprecation warnings are now shown even if you customize the warnings filters yourself. In the previous version any customization would override pytest’s filters and deprecation warnings would fall back to being hidden by default. * Allow specification of timeout for Testdir.runpytest_subprocess() and Testdir.run(). * Add returncode argument to pytest.exit() to exit pytest with a specific return code. * Reimplement pytest.deprecated_call using pytest.warns so it supports OBS-URL: https://build.opensuse.org/request/show/644834 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=18
2018-10-26 13:19:08 +02:00
BuildRequires: %{python_module setuptools >= 40.0}
2017-11-02 10:24:10 +01:00
BuildRequires: %{python_module setuptools_scm}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest = %{version}}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: python-funcsigs
BuildRequires: python-mock
BuildRequires: python3-Sphinx
BuildRequires: python3-sphinxcontrib-trio
%endif
Accepting request 644834 from home:mimi_vx:branches:devel:languages:python:pytest - update to 3.9.2 * Improve error message when a recursive dependency between fixtures is detected. * Fix logging messages not shown in hooks pytest_sessionstart() and pytest_sessionfinish(). * Fix unescaped XML raw objects in JUnit report for skipped tests * Python 2: safely format warning message about passing unicode strings to warnings.warn, which may cause surprising MemoryError exception when monkey patching warnings.warn itself. * Improve error message when it is not possible to determine a function’s signature. * Pin setuptools>=40.0 to support py_modules in setup.cfg * Restore the tmpdir behaviour of symlinking the current test run. * Fix filename reported by warnings.warn when using recwarn under python2. * For test-suites containing test classes, the information about the subclassed module is now output only if a higher verbosity level is specified (at least “-vv”). * The following accesses have been documented as deprecated for years, but are now actually emitting deprecation warnings. * Add a Deprecation warning for pytest.ensuretemp as it was deprecated since a while. * Improve usage errors messages by hiding internal details which can be distracting and noisy. This has the side effect that some error conditions that previously raised generic errors (such as ValueError for unregistered marks) are now raising Failed exceptions. * Log messages generated in the collection phase are shown when live-logging is enabled and/or when they are logged to a file. * Introduce tmp_path as a fixture providing a Path object. * Deprecation warnings are now shown even if you customize the warnings filters yourself. In the previous version any customization would override pytest’s filters and deprecation warnings would fall back to being hidden by default. * Allow specification of timeout for Testdir.runpytest_subprocess() and Testdir.run(). * Add returncode argument to pytest.exit() to exit pytest with a specific return code. * Reimplement pytest.deprecated_call using pytest.warns so it supports OBS-URL: https://build.opensuse.org/request/show/644834 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=18
2018-10-26 13:19:08 +02:00
Requires: python-atomicwrites >= 1.0
Requires: python-attrs >= 17.4.0
Requires: python-more-itertools >= 4.0.0
Accepting request 627079 from home:mimi_vx:branches:devel:languages:python:pytest - update to 3.7.0 * pytest_namespace has been deprecated. * Calling a fixture function directly, as opposed to request them in a test function, now issues a RemovedInPytest4Warning. * New package fixture scope: fixtures are finalized when the last test of a package finishes. This feature is considered experimental, so use it sparingly. * Node.add_marker now supports an append=True/False parameter to determine whether the mark comes last (default) or first. * Fixture caplog now has a messages property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler. * New --trace option to enter the debugger at the start of a test. * Introduce pytester.copy_example as helper to do acceptance tests against examples from the project. - update to 3.7.0 * pytest_namespace has been deprecated. * Calling a fixture function directly, as opposed to request them in a test function, now issues a RemovedInPytest4Warning. * New package fixture scope: fixtures are finalized when the last test of a package finishes. This feature is considered experimental, so use it sparingly. * Node.add_marker now supports an append=True/False parameter to determine whether the mark comes last (default) or first. * Fixture caplog now has a messages property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler. * New --trace option to enter the debugger at the start of a test. * Introduce pytester.copy_example as helper to do acceptance tests against examples from the project. OBS-URL: https://build.opensuse.org/request/show/627079 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=7
2018-08-02 15:12:16 +02:00
Requires: python-pluggy >= 0.7
Requires: python-py >= 1.5.0
Requires: python-setuptools
Requires: python-six >= 1.10.0
2017-11-02 10:24:10 +01:00
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%ifpython2
Requires: python-funcsigs
%endif
%if "%{python_flavor}" == "python2" || %{python3_version_nodots} < 36
Accepting request 627079 from home:mimi_vx:branches:devel:languages:python:pytest - update to 3.7.0 * pytest_namespace has been deprecated. * Calling a fixture function directly, as opposed to request them in a test function, now issues a RemovedInPytest4Warning. * New package fixture scope: fixtures are finalized when the last test of a package finishes. This feature is considered experimental, so use it sparingly. * Node.add_marker now supports an append=True/False parameter to determine whether the mark comes last (default) or first. * Fixture caplog now has a messages property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler. * New --trace option to enter the debugger at the start of a test. * Introduce pytester.copy_example as helper to do acceptance tests against examples from the project. - update to 3.7.0 * pytest_namespace has been deprecated. * Calling a fixture function directly, as opposed to request them in a test function, now issues a RemovedInPytest4Warning. * New package fixture scope: fixtures are finalized when the last test of a package finishes. This feature is considered experimental, so use it sparingly. * Node.add_marker now supports an append=True/False parameter to determine whether the mark comes last (default) or first. * Fixture caplog now has a messages property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler. * New --trace option to enter the debugger at the start of a test. * Introduce pytester.copy_example as helper to do acceptance tests against examples from the project. OBS-URL: https://build.opensuse.org/request/show/627079 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=7
2018-08-02 15:12:16 +02:00
Requires: python-pathlib2 >= 2.2.0
%endif
%python_subpackages
%description
2017-11-02 10:24:10 +01:00
pytest is a cross-project Python testing tool. It provides:
* auto-discovery of test modules and functions,
2017-11-02 10:24:10 +01:00
* detailed info on failing assert statements (no need to remember
self.assert* names),
* modular fixtures for managing small or parametrized long-lived test resources.
2017-11-02 10:24:10 +01:00
* multi-paradigm support: you can use py.test to run test suites based on
unittest (or trial), nose,
2017-11-02 10:24:10 +01:00
* 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.
%package -n python-pytest-doc
Summary: Documentation for %{name}
Group: Development/Languages/Python
Provides: %{python_module python-pytest-doc = %{version}}
%description -n python-pytest-doc
pytest is a cross-project Python testing tool. This is a documentation
for the package.
%prep
%setup -q -n pytest-%{version}
%autopatch -p1
%build
%python_build
%if %{with test}
python3 setup.py build_sphinx
rm doc/build/html/.buildinfo
%endif
%install
%if ! %{with test}
2017-11-02 10:24:10 +01:00
%python_install
%python_clone -a %{buildroot}%{_bindir}/py.test
%python_clone -a %{buildroot}%{_bindir}/pytest
2017-11-02 10:24:10 +01:00
if [ -x %{buildroot}%{_bindir}/py.test-%{python2_bin_suffix} ]; then
ln -s py.test-%{python2_bin_suffix} %{buildroot}%{_bindir}/py.test2
fi
if [ -x %{buildroot}%{_bindir}/py.test-%{python3_bin_suffix} ]; then
ln -s py.test-%{python3_bin_suffix} %{buildroot}%{_bindir}/py.test3
fi
Accepting request 618559 from devel:languages:python:pytest - update to 3.6.2 - add python-mock to buildrequires - fix test command - add python_mock.patch to use stdlib mock library on py3 - Update to version 3.6.0 + Features * Revamp the internals of the ``pytest.mark`` implementation with correct per node handling which fixes a number of long standing bugs caused by the old design. This introduces new ``Node.iter_markers(name)`` and ``Node.get_closest_mark(name)`` APIs. Users are **strongly encouraged** to read the `reasons for the revamp in the docs <https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration>`_, or jump over to details about `updating existing code to use the new APIs <https://docs.pytest.org/en/latest/mark.html#updating-code>`_. (`#3317 <https://github.com/pytest-dev/pytest/issues/3317>`_) * Now when ``@pytest.fixture`` is applied more than once to the same function a ``ValueError`` is raised. This buggy behavior would cause surprising problems and if was working for a test suite it was mostly by accident. (`#2334 <https://github.com/pytest-dev/pytest/issues/2334>`_) * Support for Python 3.7's builtin ``breakpoint()`` method, see `Using the builtin breakpoint function <https://docs.pytest.org/en/latest/usage.html#breakpoint-builtin>`_ for details. (`#3180 <https://github.com/pytest-dev/pytest/issues/3180>`_) * ``monkeypatch`` now supports a ``context()`` function which acts as a context manager which undoes all patching done within the ``with`` block. (`#3290 <https://github.com/pytest-dev/pytest/issues/3290>`_) * The ``--pdb`` option now causes KeyboardInterrupt to enter the debugger, instead of stopping the test session. On python 2.7, hitting CTRL+C again exits the debugger. On python 3.2 and higher, use CTRL+D. (`#3299 OBS-URL: https://build.opensuse.org/request/show/618559 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest?expand=0&rev=37
2018-06-25 11:35:39 +02:00
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
#Check here because in main package creates a buildcycle
%check
%if %{with test}
%{python_expand py.test-%{$python_bin_suffix}}
%endif
%post
%{python_install_alternative py.test} \
--slave %{_bindir}/pytest pytest %{_bindir}/pytest-%{python_version}
%postun
%python_uninstall_alternative py.test
%files %{python_files}
%doc AUTHORS CHANGELOG.rst README.rst
%license LICENSE
%if ! %{with test}
%python_alternative %{_bindir}/py.test
%python_alternative %{_bindir}/pytest
%python2_only %{_bindir}/py.test2
%python3_only %{_bindir}/py.test3
%{python_sitelib}/*
%endif
%if %{with test}
%files -n python-pytest-doc
%doc CHANGELOG.rst
%doc doc/build/html
%license LICENSE
%endif
%changelog