|
3 | 3 | # rather to ensure that the code does not randomly stop working. |
4 | 4 | @testitem "Test printing" setup=[TestCases] begin |
5 | 5 | using DFTK |
| 6 | + using Logging |
| 7 | + |
6 | 8 | magnesium = TestCases.magnesium |
7 | 9 |
|
8 | 10 | function test_basis_printing(; modelargs=(; temperature=1e-3), |
|
11 | 13 | disable_electrostatics_check=true, modelargs...) |
12 | 14 | basis = PlaneWaveBasis(model; basisargs...) |
13 | 15 |
|
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) |
16 | 20 |
|
17 | | - println(basis) |
18 | | - show(stdout, "text/plain", basis) |
| 21 | + @info basis |
| 22 | + show(io, "text/plain", basis) |
19 | 23 |
|
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]) |
22 | 26 |
|
23 | 27 | basis |
24 | 28 | end |
|
28 | 32 | scfres = self_consistent_field(basis; nbandsalg=FixedBands(; n_bands_converge=6), |
29 | 33 | tol=1e-3) |
30 | 34 |
|
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) |
33 | 39 | end |
34 | 40 |
|
35 | 41 | test_scfres_printing() |
|
0 commit comments