From 0bc7a16171988bdbc27487f269ad94323a5c4698 Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Thu, 29 Sep 2022 13:46:50 +0100 Subject: [PATCH] Filter out large distances in `test_linspace` --- array_api_tests/test_creation_functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/array_api_tests/test_creation_functions.py b/array_api_tests/test_creation_functions.py index 4ae92f1f..a9432429 100644 --- a/array_api_tests/test_creation_functions.py +++ b/array_api_tests/test_creation_functions.py @@ -445,6 +445,9 @@ def test_linspace(num, dtype, endpoint, data): # avoid overflow errors assume(not xp.isnan(xp.asarray(stop - start, dtype=_dtype))) assume(not xp.isnan(xp.asarray(start - stop, dtype=_dtype))) + # avoid generating very large distances + # https://github.com/data-apis/array-api-tests/issues/125 + assume(abs(stop - start) < dh.dtype_ranges[dtype].max) kw = data.draw( hh.specified_kwargs(