Skip to content

Commit 1077550

Browse files
committed
test: DRY
1 parent 941dc46 commit 1077550

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

test/front_matter.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ using TestItems
44
using TestItemRunner
55
using Preferences: set_preferences!
66

7+
ENV["SYMBOLIC_REGRESSION_IS_TESTING"] = "true"
8+
79
# Allow TEST_GROUP via ENV or the first CLI arg, default to "unit/basic"
810
const TEST_GROUP = let g = get(ENV, "TEST_GROUP", nothing)
911
g === nothing && length(ARGS) > 0 ? ARGS[1] : (g === nothing ? "unit/basic" : g)

test/runtests.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ if startswith(TEST_GROUP, "integration/")
1616
Pkg.activate(integration_dir)
1717
Pkg.instantiate()
1818

19-
if startswith(integration_name, "ext/mlj")
20-
ENV["SYMBOLIC_REGRESSION_IS_TESTING"] = "true"
21-
if integration_name == "ext/mlj/templates"
22-
include(joinpath(@__DIR__, "..", "example.jl"))
23-
include(joinpath(@__DIR__, "..", "examples", "parameterized_function.jl"))
24-
include(joinpath(@__DIR__, "..", "examples", "custom_types.jl"))
25-
end
19+
if startswith(integration_name, "ext/mlj") && integration_name == "ext/mlj/templates"
20+
include(joinpath(@__DIR__, "..", "example.jl"))
21+
include(joinpath(@__DIR__, "..", "examples", "parameterized_function.jl"))
22+
include(joinpath(@__DIR__, "..", "examples", "custom_types.jl"))
2623
end
2724

2825
@run_package_tests(

test/test_params.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ using Optim: Optim
44
using LineSearches: LineSearches
55
using Test: Test
66

7-
ENV["SYMBOLIC_REGRESSION_IS_TESTING"] = "true"
8-
97
empty_all_globals!()
108

119
const maximum_residual = 2e-2

0 commit comments

Comments
 (0)