Skip to content

Commit b9d43c2

Browse files
Update utils.jl
1 parent a5e5ec3 commit b9d43c2

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

test/utils.jl

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
using Test
22
using Optimization
3-
using Optimization: get_maxiters, maybe_with_logger, default_logger, @withprogress,
3+
using Optimization: get_maxiters,
44
decompose_trace, _check_and_convert_maxiters,
55
_check_and_convert_maxtime,
66
deduce_retcode, STOP_REASON_MAP
77
using SciMLBase: ReturnCode
8-
using Logging
9-
using ProgressLogging
10-
using LoggingExtras
11-
using ConsoleProgressMonitor
12-
using TerminalLoggers
138

149
@testset "Utils Tests" begin
1510
@testset "get_maxiters" begin
@@ -25,43 +20,6 @@ using TerminalLoggers
2520
end
2621
end
2722

28-
@testset "maybe_with_logger" begin
29-
# Test with no logger (nothing)
30-
result = maybe_with_logger(() -> 42, nothing)
31-
@test result == 42
32-
33-
# Test with logger
34-
test_logger = NullLogger()
35-
result = maybe_with_logger(() -> 24, test_logger)
36-
@test result == 24
37-
end
38-
39-
@testset "default_logger" begin
40-
# Test with logger that has progress level enabled
41-
progress_logger = ConsoleLogger(stderr, Logging.Debug)
42-
result = default_logger(progress_logger)
43-
@test result === nothing
44-
45-
# Test with logger that doesn't have progress level enabled
46-
info_logger = ConsoleLogger(stderr, Logging.Info)
47-
result = default_logger(info_logger)
48-
@test result isa LoggingExtras.TeeLogger
49-
end
50-
51-
@testset "@withprogress macro" begin
52-
# Test with progress = false
53-
result = @withprogress false begin
54-
42
55-
end
56-
@test result == 42
57-
58-
# Test with progress = true
59-
result = @withprogress true begin
60-
24
61-
end
62-
@test result == 24
63-
end
64-
6523
@testset "decompose_trace" begin
6624
# Test that it returns the input unchanged
6725
test_trace = [1, 2, 3]

0 commit comments

Comments
 (0)