Skip to content

Commit 5a3dfd2

Browse files
committed
devnull for test printing
1 parent 873cfa6 commit 5a3dfd2

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

test/printing.jl

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# rather to ensure that the code does not randomly stop working.
44
@testitem "Test printing" setup=[TestCases] begin
55
using DFTK
6+
using Logging
7+
68
magnesium = TestCases.magnesium
79

810
function test_basis_printing(; modelargs=(; temperature=1e-3),
@@ -11,14 +13,16 @@
1113
disable_electrostatics_check=true, modelargs...)
1214
basis = PlaneWaveBasis(model; basisargs...)
1315

14-
println(model)
15-
show(stdout, "text/plain", model)
16+
io = current_logger().min_level > Info ? devnull : stdout
17+
18+
@info model
19+
show(io, "text/plain", model)
1620

17-
println(basis)
18-
show(stdout, "text/plain", basis)
21+
@info basis
22+
show(io, "text/plain", basis)
1923

20-
println(basis.kpoints[1])
21-
show(stdout, "text/plain", basis.kpoints[1])
24+
@info basis.kpoints[1]
25+
show(io, "text/plain", basis.kpoints[1])
2226

2327
basis
2428
end
@@ -28,8 +32,10 @@
2832
scfres = self_consistent_field(basis; nbandsalg=FixedBands(; n_bands_converge=6),
2933
tol=1e-3)
3034

31-
println(scfres.energies)
32-
show(stdout, "text/plain", scfres.energies)
35+
io = current_logger().min_level > Info ? devnull : stdout
36+
37+
@info scfres.energies
38+
show(io, "text/plain", scfres.energies)
3339
end
3440

3541
test_scfres_printing()

0 commit comments

Comments
 (0)