From 6ac9ed170a271617f5daf6b42986539155040147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 2 Jan 2020 16:19:30 +0100 Subject: [PATCH] acceptable_failure_rate.patch: Don't use pytest private API The private API used here was removed in pytest 5. There is a public API now, pytest.ExitCode.TESTS_FAILED, however that is not yet available in pytest 4. We hardcode the value 1 instead, it is unlikely to be changed. Once pytest 4 is gone, we can switch to the new API. See https://github.com/pytest-dev/pytest/issues/5125 --- acceptable_failure_rate.patch | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/acceptable_failure_rate.patch b/acceptable_failure_rate.patch index a476409..aacb1f1 100644 --- a/acceptable_failure_rate.patch +++ b/acceptable_failure_rate.patch @@ -2,14 +2,6 @@ diff --git a/scipy/conftest.py b/scipy/conftest.py index e5fac23..1a971e8 100644 --- a/scipy/conftest.py +++ b/scipy/conftest.py -@@ -3,6 +3,7 @@ from __future__ import division, absolute_import, print_function - - import os - import pytest -+import _pytest - import warnings - - from distutils.version import LooseVersion @@ -37,3 +38,15 @@ def check_fpu_mode(request): warnings.warn("FPU mode changed from {0:#x} to {1:#x} during " "the test".format(old_mode, new_mode), @@ -21,7 +13,7 @@ index e5fac23..1a971e8 100644 + +@pytest.hookimpl() +def pytest_sessionfinish(session, exitstatus): -+ if exitstatus != _pytest.main.EXIT_TESTSFAILED: ++ if exitstatus != 1: + return + failure_rate = (100.0 * session.testsfailed) / session.testscollected + if failure_rate <= ACCEPTABLE_FAILURE_RATE: