Skip to content

Commit cfe9111

Browse files
committed
remove unnecessary push/pop testset calls since record records into the testset anyway
1 parent 76f941b commit cfe9111

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

test/runtests.jl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,11 @@ println("Testing finished in $elapsed")
330330

331331
# construct a testset to render the test results
332332
o_ts = Test.DefaultTestSet("Overall")
333-
Test.push_testset(o_ts)
334333
completed_tests = Set{String}()
335334
for (testname, (resp,)) in results
336335
push!(completed_tests, testname)
337336
if isa(resp, Test.DefaultTestSet)
338-
Test.push_testset(resp)
339337
Test.record(o_ts, resp)
340-
Test.pop_testset()
341338
elseif isa(resp, Tuple{Int,Int})
342339
fake = Test.DefaultTestSet(testname)
343340
for i in 1:resp[1]
@@ -346,9 +343,7 @@ for (testname, (resp,)) in results
346343
for i in 1:resp[2]
347344
Test.record(fake, Test.Broken(:test, nothing))
348345
end
349-
Test.push_testset(fake)
350346
Test.record(o_ts, fake)
351-
Test.pop_testset()
352347
elseif isa(resp, RemoteException) && isa(resp.captured.ex, Test.TestSetException)
353348
println("Worker $(resp.pid) failed running test $(testname):")
354349
Base.showerror(stdout, resp.captured)
@@ -363,9 +358,7 @@ for (testname, (resp,)) in results
363358
for t in resp.captured.ex.errors_and_fails
364359
Test.record(fake, t)
365360
end
366-
Test.push_testset(fake)
367361
Test.record(o_ts, fake)
368-
Test.pop_testset()
369362
else
370363
if !isa(resp, Exception)
371364
resp = ErrorException(string("Unknown result type : ", typeof(resp)))
@@ -376,19 +369,17 @@ for (testname, (resp,)) in results
376369
# deserialization errors or something similar. Record this testset as Errored.
377370
fake = Test.DefaultTestSet(testname)
378371
Test.record(fake, Test.Error(:nontest_error, testname, nothing, Any[(resp, [])], LineNumberNode(1)))
379-
Test.push_testset(fake)
380372
Test.record(o_ts, fake)
381-
Test.pop_testset()
382373
end
383374
end
384375
for test in tests
385376
(test in completed_tests) && continue
386377
fake = Test.DefaultTestSet(test)
387378
Test.record(fake, Test.Error(:test_interrupted, test, nothing,
388-
[("skipped", [])], LineNumberNode(1)))
389-
Test.push_testset(fake)
379+
[("skipped", [])], LineNumberNode(1)
380+
)
381+
)
390382
Test.record(o_ts, fake)
391-
Test.pop_testset()
392383
end
393384
println()
394385
Test.print_test_results(o_ts, 1)

0 commit comments

Comments
 (0)