Skip to content

Commit

Permalink
fix tests on nightly (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinschmidt authored Mar 14, 2023
1 parent 63d72c4 commit 98f7fb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/schema.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ function concrete_term(t::Term, xs::AbstractArray, contrasts::AbstractContrasts)
CategoricalTerm(t.sym, contrmat)
end

# this catches early when someone provides `:x => DummyCoding` as a hint
function concrete_term(t::Term, xs::AbstractArray, ::Type{T}) where {T<:AbstractContrasts}
throw(ArgumentError("contrast types must be instantiated (use $T() instead of $T)"))
end

"""
apply_schema(t, schema::StatsModels.Schema[, Mod::Type = Nothing])
Expand Down
2 changes: 1 addition & 1 deletion test/contrasts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@

# contrasts types must be instantiated (should throw ArgumentError, currently
# MethodError on apply_schema)
@test_broken setcontrasts!(mf, x = DummyCoding)
@test_throws ArgumentError setcontrasts!(mf, x = DummyCoding)

@testset "hypothesis coding" begin

Expand Down
5 changes: 3 additions & 2 deletions test/formula.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@
@formula(foo ~ bar + baz)

# drop_term no longer checks for whether term is found...
@test_broken drop_term(@formula(foo ~ bar + baz), term(0))
@test_broken drop_term(@formula(foo ~ bar + baz), term(:boz))
f = @formula(foo ~ bar + baz)
@test drop_term(f, term(0)) == f
@test drop_term(f, term(:boz)) == f

form = @formula(foo ~ 1 + bar + baz)
@test form == @formula(foo ~ 1 + bar + baz)
Expand Down

2 comments on commit 98f7fb6

@kleinschmidt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/79527

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.0 -m "<description of version>" 98f7fb67e1e2ed243e8a1abd05ab8065b12bf350
git push origin v0.7.0

Please sign in to comment.