Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix verbosity bug #42

Merged
merged 3 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .github/workflows/ci_nightly.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJTestIntegration"
uuid = "697918b4-fdc1-4f9e-8ff9-929724cee270"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.5.0"
version = "0.5.1"

[deps]
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
Expand Down
10 changes: 4 additions & 6 deletions src/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,10 @@ function test(model; mod=Main, level=2, throw=false, verbosity=1,)
println()
end
if !isempty(fails)
if verbosity > 0
@warn "\n Failures encounted for these tests:"
for e in fails
@warn "\t [$(e.test)]"
push!(exceptions, e)
end
verbosity > 0 && @warn "\n Failures encounted for these tests:"
for e in fails
@warn "\t [$(e.test)]"
push!(exceptions, e)
end
end
end
Expand Down
15 changes: 15 additions & 0 deletions test/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using MLJTestIntegration
using MLJ
using MLJModels
const MTI = MLJTestIntegration
const MMI = MLJ.MLJBase.MLJModelInterface

classifiers = [
(name = "ConstantClassifier", package_name = "MLJModels"),
Expand Down Expand Up @@ -315,4 +316,18 @@ end
)
end

struct JunkModel <: Deterministic end

MMI.fit(::JunkModel, verbosity, X, y) = error("I am always broken")
MMI.input_scitype(::Type{JunkModel}) = Table(Continuous)
MMI.target_scitype(::Type{JunkModel}) = AbstractVector{<:Continuous}

@testset "test(model, ...) catches failure" begin
@test(@test_logs(
(:warn, MTI.WARN_FAILURES_ENCOUNTERED),
match_mode=:any,
!isempty(MTI.test(JunkModel; mod=@__MODULE__, verbosity=0, throw=false)),
))
end

true
Loading