Skip to content

Commit 697e528

Browse files
committed
hijack: fix old testset kwarg
The `testset` kwarg was renamed to `include`. In `load`, pass `nothing` (for `include`) instead of `false` (for `testset`). This was a silent bug. In `hijack_base`, don't pass `testset` kwarg to `populate_mod!` (but it's not relevant there). This bug was not silent, but `hijack_base` is not tested.
1 parent d1fea44 commit 697e528

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hijack.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function load(testpath::AbstractString;
3030
Base.include(parentmodule, testpath)
3131
else
3232
files = Dict{String,Module}(testpath => parentmodule)
33-
substitute!(x) = substitute_retest!(x, false, false, files; ishijack=false)
33+
substitute!(x) = substitute_retest!(x, false, nothing, files; ishijack=false)
3434
res = Base.include(substitute!, parentmodule, testpath)
3535
revise_track(Revise, files)
3636
res
@@ -234,7 +234,7 @@ const root_module = Ref{Symbol}()
234234

235235
__init__() = root_module[] = gensym("MODULE")
236236

237-
function populate_mod!(mod::Module, path; lazy, Revise, include)
237+
function populate_mod!(mod::Module, path; lazy, Revise, include::Maybe{Symbol}=nothing)
238238
lazy (true, false, :brutal) ||
239239
throw(ArgumentError("the `lazy` keyword must be `true`, `false` or `:brutal`"))
240240

@@ -290,7 +290,7 @@ function hijack(packagemod::Module, modname=nothing; parentmodule::Module=Main,
290290
end
291291
end
292292

293-
function substitute_retest!(ex, lazy, include_, files=nothing;
293+
function substitute_retest!(ex, lazy, include_::Maybe{Symbol}, files=nothing;
294294
ishijack::Bool=true)
295295
substitute!(x) = substitute_retest!(x, lazy, include_, files, ishijack=ishijack)
296296

@@ -495,7 +495,7 @@ function hijack_base(tests, modname=nothing; parentmodule::Module=Main, lazy=fal
495495
@eval mod begin
496496
using Random
497497
end
498-
populate_mod!(mod, ChooseTests.test_path(test), lazy=lazy, Revise=Revise, testset=false)
498+
populate_mod!(mod, ChooseTests.test_path(test), lazy=lazy, Revise=Revise)
499499
end
500500
end
501501

0 commit comments

Comments
 (0)