File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
import functools
2
2
import math
3
3
import os
4
- import warnings
5
4
from unittest .mock import patch
6
5
7
6
import naive
@@ -1758,14 +1757,11 @@ def test_process_isconstant_2d():
1758
1757
npt .assert_array_equal (T_subseq_isconstant_ref , T_subseq_isconstant_comp )
1759
1758
1760
1759
1761
- def test_preprocess_diagonal_std_inverse ():
1760
+ @pytest .mark .filterwarnings (
1761
+ "error:divide by zero encountered in divide" , category = RuntimeWarning
1762
+ )
1763
+ def test_preprocess_diagonal_divide_by_zero ():
1762
1764
T = np .random .rand (64 )
1763
1765
m = 3
1764
1766
T [:m ] = np .nan
1765
-
1766
- with warnings .catch_warnings (record = True ) as w :
1767
- warnings .simplefilter ("always" )
1768
- core .preprocess_diagonal (T , m )
1769
- for item in w :
1770
- if issubclass (item .category , RuntimeWarning ):
1771
- assert "divide by zero encountered in divide" not in str (item .message )
1767
+ core .preprocess_diagonal (T , m )
You can’t perform that action at this time.
0 commit comments