From c4f6cb2ab7571b97028feea5c1bf0bd1ec2dd2d6 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 10 May 2020 07:53:46 -0400 Subject: [PATCH 1/2] Add Suppressor.jl to tests' deps --- Project.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 1a050a8..1e52bf5 100644 --- a/Project.toml +++ b/Project.toml @@ -26,9 +26,10 @@ julia = "1" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e" Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" +Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a" [targets] -test = ["Test", "Roots", "Unitful", "UnitfulAtomic", "IterTools", "CSV"] +test = ["Test", "Roots", "Unitful", "UnitfulAtomic", "IterTools", "CSV", "Suppressor"] From 564aeb157e9de0ded5de20b134951e4dae9ebfe4 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 10 May 2020 07:56:38 -0400 Subject: [PATCH 2/2] Use `@suppress` in test/Find.jl too much `@info`s --- test/Find.jl | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/test/Find.jl b/test/Find.jl index beabc74..ede6720 100644 --- a/test/Find.jl +++ b/test/Find.jl @@ -1,8 +1,8 @@ module Find -using Test - using Roots +using Suppressor: @suppress +using Test using Unitful using UnitfulAtomic @@ -74,21 +74,23 @@ using EquationsOfState.Find -9.86535084973, -9.73155247952, ] .* u"eV" - isapprox( - map(energies) do e - findvolume( - BirchMurnaghan3rd( - 40.98926572528106 * u"angstrom^3", - 0.5369258245417454 * u"eV/angstrom^3", - 4.178644235500821 * u"1000mm/m", - -10.842803908240892 * u"eV", - )(Energy()), - e, - (eps(), 100) .* u"angstrom^3", - ) - end, - results, - ) + @suppress begin + isapprox( + map(energies) do e + findvolume( + BirchMurnaghan3rd( + 40.98926572528106 * u"angstrom^3", + 0.5369258245417454 * u"eV/angstrom^3", + 4.178644235500821 * u"1000mm/m", + -10.842803908240892 * u"eV", + )(Energy()), + e, + (eps(), 100) .* u"angstrom^3", + ) + end, + results, + ) + end end @testset "Test `findvolume` with random unit" begin @@ -97,11 +99,13 @@ end volumes = map(pressures) do p findvolume(eos(Pressure()), p, (eps(1.0 * u"bohr^3"), eos.v0 * 1.3)) end - @test isapprox( - ustrip.(map(eos(Pressure()), volumes) - pressures), - zeros(11), - atol = 1e-5, - ) + @suppress begin + @test isapprox( + ustrip.(map(eos(Pressure()), volumes) - pressures), + zeros(11), + atol = 1e-5, + ) + end end # testset end # module Find