@@ -450,12 +450,12 @@ def fcn(y, x):
450
450
451
451
452
452
def test_make_func_code ():
453
- with pytest .warns (np .VisibleDeprecationWarning ):
453
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
454
454
fc = util .make_func_code (["a" , "b" ])
455
455
assert fc .co_varnames == ("a" , "b" )
456
456
assert fc .co_argcount == 2
457
457
458
- with pytest .warns (np .VisibleDeprecationWarning ):
458
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
459
459
fc = util .make_func_code (("x" ,))
460
460
assert fc .co_varnames == ("x" ,)
461
461
assert fc .co_argcount == 1
@@ -530,14 +530,14 @@ def test_propagate_1():
530
530
def fn (x ):
531
531
return 2 * x + 1
532
532
533
- with pytest .warns (np .VisibleDeprecationWarning ):
533
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
534
534
y , ycov = util .propagate (fn , x , cov )
535
535
np .testing .assert_allclose (y , [3 , 5 , 7 ])
536
536
np .testing .assert_allclose (
537
537
ycov , [[4 , 0.4 , 0.8 ], [0.4 , 8 , 1.2 ], [0.8 , 1.2 , 12 ]], rtol = 1e-3
538
538
)
539
539
540
- with pytest .warns (np .VisibleDeprecationWarning ):
540
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
541
541
y , ycov = util .propagate (fn , [1 ], [[2 ]])
542
542
np .testing .assert_allclose (y , 3 )
543
543
np .testing .assert_allclose (ycov , 8 , rtol = 1e-3 )
@@ -557,15 +557,15 @@ def test_propagate_2():
557
557
def fn (x ):
558
558
return np .dot (a , x )
559
559
560
- with pytest .warns (np .VisibleDeprecationWarning ):
560
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
561
561
y , ycov = util .propagate (fn , x , cov )
562
562
np .testing .assert_equal (y , fn (x ))
563
563
np .testing .assert_allclose (ycov , np .einsum ("ij,kl,jl" , a , a , cov ), rtol = 1e-3 )
564
564
565
565
def fn (x ):
566
566
return np .linalg .multi_dot ([x .T , cov , x ])
567
567
568
- with pytest .warns (np .VisibleDeprecationWarning ):
568
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
569
569
y , ycov = util .propagate (fn , x , cov )
570
570
np .testing .assert_equal (y , fn (np .array (x )))
571
571
jac = 2 * np .dot (cov , x )
@@ -585,7 +585,7 @@ def test_propagate_3():
585
585
def fn (x ):
586
586
return 2 * x + 1
587
587
588
- with pytest .warns (np .VisibleDeprecationWarning ):
588
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
589
589
y , ycov = util .propagate (fn , x , cov )
590
590
np .testing .assert_allclose (y , [3 , 5 , 7 ])
591
591
np .testing .assert_allclose (ycov , [[4 , 0.0 , 0.8 ], [0.0 , 0.0 , 0.0 ], [0.8 , 0.0 , 12 ]])
@@ -599,16 +599,16 @@ def test_propagate_on_bad_input():
599
599
def fn (x ):
600
600
return 2 * x + 1
601
601
602
- with pytest .warns (np .VisibleDeprecationWarning ):
602
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
603
603
with pytest .raises (ValueError ):
604
604
util .propagate (fn , x , cov )
605
605
606
- with pytest .warns (np .VisibleDeprecationWarning ):
606
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
607
607
with pytest .raises (ValueError ):
608
608
util .propagate (fn , x , 1 )
609
609
610
610
cov = [[1.0 ], [1.0 ]]
611
- with pytest .warns (np .VisibleDeprecationWarning ):
611
+ with pytest .warns (np .exceptions . VisibleDeprecationWarning ):
612
612
with pytest .raises (ValueError ):
613
613
util .propagate (fn , x , cov )
614
614
0 commit comments