Skip to content

Commit 532ba04

Browse files
committed
Use LMcontext in the tests
1 parent 324efbf commit 532ba04

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/MOI_wrapper.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ using Test
1010
import KNITRO
1111
import MathOptInterface as MOI
1212

13+
const LICENSE_MANAGER = KNITRO.LMcontext()
14+
1315
function runtests()
1416
for name in names(@__MODULE__; all=true)
1517
if startswith("$(name)", "test_")
@@ -22,7 +24,9 @@ function runtests()
2224
end
2325

2426
function test_runtests()
25-
model = MOI.instantiate(KNITRO.Optimizer)
27+
model = MOI.instantiate(
28+
() -> KNITRO.Optimizer(; license_manager=LICENSE_MANAGER),
29+
)
2630
config = MOI.Test.Config(
2731
atol=1e-3,
2832
rtol=1e-3,
@@ -57,8 +61,11 @@ function test_MOI_Test_cached()
5761
r"^test_conic_SecondOrderCone_out_of_order$",
5862
r"^test_constraint_PrimalStart_DualStart_SecondOrderCone$",
5963
]
60-
model =
61-
MOI.instantiate(KNITRO.Optimizer; with_bridge_type=Float64, with_cache_type=Float64)
64+
model = MOI.instantiate(
65+
() -> KNITRO.Optimizer(; license_manager=LICENSE_MANAGER);
66+
with_bridge_type=Float64,
67+
with_cache_type=Float64,
68+
)
6269
MOI.set(model, MOI.Silent(), true)
6370
config = MOI.Test.Config(
6471
atol=2e-3,

0 commit comments

Comments
 (0)