2018-06-23 21:00:13 +00:00
|
|
|
diff --git a/scipy/conftest.py b/scipy/conftest.py
|
2019-02-06 23:30:32 +00:00
|
|
|
index e5fac23..1a971e8 100644
|
2018-06-23 21:00:13 +00:00
|
|
|
--- a/scipy/conftest.py
|
|
|
|
+++ b/scipy/conftest.py
|
2019-02-06 23:30:32 +00:00
|
|
|
@@ -37,3 +38,15 @@ def check_fpu_mode(request):
|
2018-06-23 21:00:13 +00:00
|
|
|
warnings.warn("FPU mode changed from {0:#x} to {1:#x} during "
|
|
|
|
"the test".format(old_mode, new_mode),
|
|
|
|
category=FPUModeChangeWarning, stacklevel=0)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ACCEPTABLE_FAILURE_RATE = int(os.environ.get('ACCEPTABLE_FAILURE_RATE', 0))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@pytest.hookimpl()
|
|
|
|
+def pytest_sessionfinish(session, exitstatus):
|
2020-01-02 15:19:30 +00:00
|
|
|
+ if exitstatus != 1:
|
2018-06-23 21:00:13 +00:00
|
|
|
+ return
|
|
|
|
+ failure_rate = (100.0 * session.testsfailed) / session.testscollected
|
|
|
|
+ if failure_rate <= ACCEPTABLE_FAILURE_RATE:
|
|
|
|
+ session.exitstatus = 0
|