Skip to content

Commit a33f206

Browse files
authored
Merge pull request #43 from JuliaAI/dev
For a 0.5.1 release
2 parents 02c504f + eb9cdee commit a33f206

File tree

4 files changed

+20
-57
lines changed

4 files changed

+20
-57
lines changed

.github/workflows/ci_nightly.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJTestIntegration"
22
uuid = "697918b4-fdc1-4f9e-8ff9-929724cee270"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "0.5.0"
4+
version = "0.5.1"
55

66
[deps]
77
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"

src/test.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,10 @@ function test(model; mod=Main, level=2, throw=false, verbosity=1,)
491491
println()
492492
end
493493
if !isempty(fails)
494-
if verbosity > 0
495-
@warn "\n Failures encounted for these tests:"
496-
for e in fails
497-
@warn "\t [$(e.test)]"
498-
push!(exceptions, e)
499-
end
494+
verbosity > 0 && @warn "\n Failures encounted for these tests:"
495+
for e in fails
496+
@warn "\t [$(e.test)]"
497+
push!(exceptions, e)
500498
end
501499
end
502500
end

test/test.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using MLJTestIntegration
44
using MLJ
55
using MLJModels
66
const MTI = MLJTestIntegration
7+
const MMI = MLJ.MLJBase.MLJModelInterface
78

89
classifiers = [
910
(name = "ConstantClassifier", package_name = "MLJModels"),
@@ -315,4 +316,18 @@ end
315316
)
316317
end
317318

319+
struct JunkModel <: Deterministic end
320+
321+
MMI.fit(::JunkModel, verbosity, X, y) = error("I am always broken")
322+
MMI.input_scitype(::Type{JunkModel}) = Table(Continuous)
323+
MMI.target_scitype(::Type{JunkModel}) = AbstractVector{<:Continuous}
324+
325+
@testset "test(model, ...) catches failure" begin
326+
@test(@test_logs(
327+
(:warn, MTI.WARN_FAILURES_ENCOUNTERED),
328+
match_mode=:any,
329+
!isempty(MTI.test(JunkModel; mod=@__MODULE__, verbosity=0, throw=false)),
330+
))
331+
end
332+
318333
true

0 commit comments

Comments
 (0)