From 4f81430dffb8914dedee072ac9eb4cc0085fbfccb9c5d7a047b6636270082167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 9 May 2019 13:26:28 +0000 Subject: [PATCH] Accepting request 701805 from home:mcepl:branches:devel:languages:python:pytest - Add fix-test-fast.patch to avoid failing tests/test_normal.py::test_fast test on 32bit platform. OBS-URL: https://build.opensuse.org/request/show/701805 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-benchmark?expand=0&rev=9 --- fix-test-fast.patch | 22 ++++++++++++++++++++++ python-pytest-benchmark.changes | 6 ++++++ python-pytest-benchmark.spec | 2 ++ 3 files changed, 30 insertions(+) create mode 100644 fix-test-fast.patch diff --git a/fix-test-fast.patch b/fix-test-fast.patch new file mode 100644 index 0000000..5baad25 --- /dev/null +++ b/fix-test-fast.patch @@ -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): diff --git a/python-pytest-benchmark.changes b/python-pytest-benchmark.changes index 9d19373..37d0f2b 100644 --- a/python-pytest-benchmark.changes +++ b/python-pytest-benchmark.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 9 14:49:19 CEST 2019 - Matej Cepl + +- 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 diff --git a/python-pytest-benchmark.spec b/python-pytest-benchmark.spec index 22e6cef..42b63be 100644 --- a/python-pytest-benchmark.spec +++ b/python-pytest-benchmark.spec @@ -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