forked from pool/python-flaky
Accepting request 855334 from home:mcepl:branches:devel:tools:scm
- Add remove_mock.patch to remove dependency on the external mock package. - Add remove_nose.patch to remove dependency on nose. OBS-URL: https://build.opensuse.org/request/show/855334 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flaky?expand=0&rev=15
This commit is contained in:
@@ -31,6 +31,12 @@ Summary: Plugin for nose or py.test that automatically reruns flaky tests
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/box/flaky
|
||||
Source: https://files.pythonhosted.org/packages/source/f/flaky/flaky-%{version}.tar.gz
|
||||
# PATCH-FEATURE-UPSTREAM remove_nose.patch gh#box/flaky#171 mcepl@suse.com
|
||||
# remove dependency on nose
|
||||
Patch0: remove_nose.patch
|
||||
# PATCH-FEATURE-UPSTREAM remove_mock.patch gh#box/flaky#171 mcepl@suse.com
|
||||
# this patch makes things totally awesome
|
||||
Patch1: remove_mock.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -38,14 +44,12 @@ BuildArch: noarch
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module flaky >= %{version}}
|
||||
BuildRequires: %{python_module genty}
|
||||
BuildRequires: %{python_module mock}
|
||||
BuildRequires: %{python_module nose}
|
||||
BuildRequires: %{python_module pytest}
|
||||
%endif
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
|
||||
Flaky is a plugin for py.test that automatically reruns flaky tests.
|
||||
|
||||
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100%
|
||||
reliable. With flaky, instead of removing those tests or marking them to @skip, they can be automatically
|
||||
@@ -54,7 +58,7 @@ retried.
|
||||
For more information about flaky, see `this presentation <http://opensource.box.com/flaky/>`_.
|
||||
|
||||
%prep
|
||||
%setup -q -n flaky-%{version}
|
||||
%autosetup -p1 -n flaky-%{version}
|
||||
|
||||
%if !%{with test}
|
||||
%build
|
||||
@@ -69,16 +73,11 @@ For more information about flaky, see `this presentation <http://opensource.box.
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
%{python_expand echo
|
||||
nosetests="nosetests-%{$python_bin_suffix}"
|
||||
pytest="pytest-%{$python_bin_suffix}"
|
||||
$nosetests --with-flaky --exclude="test_nose_options_example" test/test_nose/
|
||||
$pytest -k 'example and not options' --doctest-modules test/test_pytest/
|
||||
$pytest -k 'example and not options' test/test_pytest/
|
||||
$pytest -p no:flaky test/test_pytest/test_flaky_pytest_plugin.py
|
||||
$nosetests --with-flaky --force-flaky --max-runs 2 test/test_nose/test_nose_options_example.py
|
||||
$pytest --force-flaky --max-runs 2 test/test_pytest/test_pytest_options_example.py
|
||||
}
|
||||
%pytest -k 'example and not options' --doctest-modules test/test_pytest/
|
||||
%pytest -k 'example and not options' test/test_pytest/
|
||||
%pytest -p no:flaky test/test_pytest/test_flaky_pytest_plugin.py
|
||||
export PYTEST_ADDOPTS="--force-flaky --max-runs 2"
|
||||
%pytest test/test_pytest/test_pytest_options_example.py
|
||||
%endif
|
||||
|
||||
%if !%{with test}
|
||||
|
Reference in New Issue
Block a user