Closed cgarling closed 2 years ago
This PR runs our doctests as part of our runtests.jl test suite so that we can get code coverage info including the doctests without having to duplicate the doctests in runtest.jl.
We occasionally run into issues with deprecation warnings in the doctests for our z_at_value
function because of Roots.jl's find_zeros
function. This is inconsistent but seems to depend on whether Roots v1.4.1 or a variant of Roots v2 is installed. I have tried changing the call signature for find_zeros
but have been unsuccessful at figuring out how to get rid of the warnings.
To get around this we set depwarn=no for the julia-runtest
CI action which allows the doctests to pass on CI. When running the tests locally, you may have to do import Pkg; import Cosmology; Pkg.test("Cosmology";julia_args=["--depwarn=no"])
in order for the tests to pass. Strangely if I activate the test environment and include("runtests.jl")
I don't get these warnings.
As part of this PR the doctests for some of the radiation density methods were changed; there was a ~1ulp change in the results between some versions of Julia, so these tests became isapprox
tests rather than isequal
.
Codecov Report
73.07% <ø> (+11.53%)
58.16% <0.00%> (+5.10%)
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.