|
138 | 138 | @test mean(Int[]) isa Float64 |
139 | 139 | @test isequal(mean(skipmissing(Int[])), NaN) |
140 | 140 | @test mean(skipmissing(Int[])) isa Float64 |
141 | | - @test_throws MethodError mean([]) |
142 | | - @test_throws MethodError mean(skipmissing([])) |
| 141 | + @test_throws Exception mean([]) |
| 142 | + @test_throws Exception mean(skipmissing([])) |
143 | 143 | @test_throws ArgumentError mean((1 for i in 2:1)) |
144 | 144 | if VERSION >= v"1.6.0-DEV.83" |
145 | 145 | @test_throws ArgumentError mean(()) |
@@ -187,10 +187,10 @@ end |
187 | 187 | @testset "var & std" begin |
188 | 188 | # edge case: empty vector |
189 | 189 | # iterable; this has to throw for type stability |
190 | | - @test_throws MethodError var(()) |
191 | | - @test_throws MethodError var((); corrected=false) |
192 | | - @test_throws MethodError var((); mean=2) |
193 | | - @test_throws MethodError var((); mean=2, corrected=false) |
| 190 | + @test_throws Exception var(()) |
| 191 | + @test_throws Exception var((); corrected=false) |
| 192 | + @test_throws Exception var((); mean=2) |
| 193 | + @test_throws Exception var((); mean=2, corrected=false) |
194 | 194 | # reduction |
195 | 195 | @test isnan(var(Int[])) |
196 | 196 | @test isnan(var(Int[]; corrected=false)) |
|
331 | 331 | @test var(Complex{Float64}[]) isa Float64 |
332 | 332 | @test isequal(var(skipmissing(Complex{Float64}[])), NaN) |
333 | 333 | @test var(skipmissing(Complex{Float64}[])) isa Float64 |
334 | | - @test_throws MethodError var([]) |
335 | | - @test_throws MethodError var(skipmissing([])) |
336 | | - @test_throws MethodError var((1 for i in 2:1)) |
| 334 | + @test_throws Exception var([]) |
| 335 | + @test_throws Exception var(skipmissing([])) |
| 336 | + @test_throws Exception var((1 for i in 2:1)) |
337 | 337 | @test isequal(var(Int[]), NaN) |
338 | 338 | @test var(Int[]) isa Float64 |
339 | 339 | @test isequal(var(skipmissing(Int[])), NaN) |
@@ -464,9 +464,9 @@ Y = [6.0 2.0; |
464 | 464 | @testset "cov with missing" begin |
465 | 465 | @test cov([missing]) === cov([1, missing]) === missing |
466 | 466 | @test cov([1, missing], [2, 3]) === cov([1, 3], [2, missing]) === missing |
467 | | - @test_throws MethodError cov([1 missing; 2 3]) |
468 | | - @test_throws MethodError cov([1 missing; 2 3], [1, 2]) |
469 | | - @test_throws MethodError cov([1, 2], [1 missing; 2 3]) |
| 467 | + @test_throws Exception cov([1 missing; 2 3]) |
| 468 | + @test_throws Exception cov([1 missing; 2 3], [1, 2]) |
| 469 | + @test_throws Exception cov([1, 2], [1 missing; 2 3]) |
470 | 470 | @test isequal(cov([1 2; 2 3], [1, missing]), [missing missing]') |
471 | 471 | @test isequal(cov([1, missing], [1 2; 2 3]), [missing missing]) |
472 | 472 | end |
@@ -559,25 +559,25 @@ end |
559 | 559 |
|
560 | 560 | @test cor(Int[]) === 1.0 |
561 | 561 | @test cor([im]) === 1.0 + 0.0im |
562 | | - @test_throws MethodError cor([]) |
563 | | - @test_throws MethodError cor(Any[1.0]) |
| 562 | + @test_throws Exception cor([]) |
| 563 | + @test_throws Exception cor(Any[1.0]) |
564 | 564 |
|
565 | 565 | @test cor([1, missing]) === 1.0 |
566 | 566 | @test ismissing(cor([missing])) |
567 | | - @test_throws MethodError cor(Any[1.0, missing]) |
| 567 | + @test_throws Exception cor(Any[1.0, missing]) |
568 | 568 |
|
569 | 569 | @test Statistics.corm([true], 1.0) === 1.0 |
570 | | - @test_throws MethodError Statistics.corm(Any[0.0, 1.0], 0.5) |
| 570 | + @test_throws Exception Statistics.corm(Any[0.0, 1.0], 0.5) |
571 | 571 | @test Statistics.corzm([true]) === 1.0 |
572 | | - @test_throws MethodError Statistics.corzm(Any[0.0, 1.0]) |
| 572 | + @test_throws Exception Statistics.corzm(Any[0.0, 1.0]) |
573 | 573 |
|
574 | 574 | @testset "cor with missing" begin |
575 | 575 | @test cor([missing]) === missing |
576 | 576 | @test cor([1, missing]) == 1 |
577 | 577 | @test cor([1, missing], [2, 3]) === cor([1, 3], [2, missing]) === missing |
578 | | - @test_throws MethodError cor([1 missing; 2 3]) |
579 | | - @test_throws MethodError cor([1 missing; 2 3], [1, 2]) |
580 | | - @test_throws MethodError cor([1, 2], [1 missing; 2 3]) |
| 578 | + @test_throws Exception cor([1 missing; 2 3]) |
| 579 | + @test_throws Exception cor([1 missing; 2 3], [1, 2]) |
| 580 | + @test_throws Exception cor([1, 2], [1 missing; 2 3]) |
581 | 581 | @test isequal(cor([1 2; 2 3], [1, missing]), [missing missing]') |
582 | 582 | @test isequal(cor([1, missing], [1 2; 2 3]), [missing missing]) |
583 | 583 | end |
|
0 commit comments