Accepting request 701806 from devel:languages:python:pytest

OBS-URL: https://build.opensuse.org/request/show/701806
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-benchmark?expand=0&rev=3
This commit is contained in:
Dominique Leuenberger 2019-05-16 19:55:57 +00:00 committed by Git OBS Bridge
commit 9ba66712e7
3 changed files with 30 additions and 0 deletions

22
fix-test-fast.patch Normal file
View File

@ -0,0 +1,22 @@
--- a/tests/test_normal.py
+++ b/tests/test_normal.py
@@ -5,6 +5,7 @@ Just to make sure the plugin doesn't cho
Yay, doctests!
"""
+import platform
import sys # noqa
import time
from functools import partial
@@ -20,7 +21,10 @@ def test_fast(benchmark):
assert result is None
if not benchmark.disabled:
- assert benchmark.stats.stats.min >= 0.000001
+ if '32' in platform.architecture()[0]:
+ assert benchmark.stats.stats.min >= 0.0000001
+ else:
+ assert benchmark.stats.stats.min >= 0.000001
def test_slow(benchmark):

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 9 14:49:19 CEST 2019 - Matej Cepl <mcepl@suse.com>
- Add fix-test-fast.patch to avoid failing
tests/test_normal.py::test_fast test on 32bit platform.
-------------------------------------------------------------------
Thu Mar 28 13:13:55 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -25,6 +25,7 @@ License: BSD-2-Clause
Group: Development/Languages/Python
URL: https://github.com/ionelmc/pytest-benchmark
Source: https://files.pythonhosted.org/packages/source/p/pytest-benchmark/pytest-benchmark-%{version}.tar.gz
Patch0: fix-test-fast.patch
BuildRequires: %{python_module aspectlib}
BuildRequires: %{python_module elasticsearch}
BuildRequires: %{python_module freezegun}
@ -61,6 +62,7 @@ rounds that are calibrated to the chosen timer.
%prep
%setup -q -n pytest-benchmark-%{version}
%autopatch -p1
# skip cli tests as we use update-alternatives
rm -f tests/test_cli.py