From fbd6b71f4659c433557d34e3fff2b24d002d238a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 20 Feb 2022 23:02:18 -0600 Subject: [PATCH] Use np.errstate to raise on numpy errors, instead of a warning filter --- test/test_codegen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test_codegen.py b/test/test_codegen.py index 05a093a5b..0defcb0ef 100755 --- a/test/test_codegen.py +++ b/test/test_codegen.py @@ -1333,11 +1333,9 @@ def test_random_dag_against_numpy(ctx_factory): from testlib import RandomDAGContext, make_random_dag axis_len = 5 - from warnings import filterwarnings, catch_warnings - with catch_warnings(): - # We'd like to know if Numpy divides by zero. - filterwarnings("error") + # We'd like to know if Numpy divides by zero. + with np.errstate(all="raise"): for i in range(50): print(i) # progress indicator for somewhat slow test