Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture deprecation warnings in tests #117

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ jobs:
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- name: Cache artifacts
uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: |
~/.julia/artifacts
~/.julia/registries
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-uploadcodecov@v0.1
Expand All @@ -57,19 +45,9 @@ jobs:
- uses: julia-actions/setup-julia@latest
with:
version: 1
- name: Cache artifacts
uses: actions/cache@v2
env:
cache-name: cache-artifacts
- uses: julia-actions/cache@v1
with:
path: |
~/.julia/artifacts
~/.julia/registries
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/docs/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
cache-registries: "true"
- uses: julia-actions/julia-docdeploy@releases/v1
env:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,12 @@ end
end

@testset "Factorial and gamma" begin
@test @inferred(factorial(x)) ≈ measurement(6, 0.7536706010590813)
@test_logs (:warn, r"factorial.*is deprecated") @test @inferred(factorial(x)) ≈ measurement(6, 0.7536706010590813)
@test @inferred(digamma(y)) ≈ 1.256117668431802 ± 0.056764591147422994
@test @inferred(polygamma(3, w)) ≈ 193.40909103400242 ± 0.10422749480000776
for a in (w, x, y)
@test @inferred(gamma(a)) ≈ factorial(a - one(a))
@test @inferred(gamma(a + one(a))) ≈ factorial(a)
@test_logs (:warn, r"factorial.*is deprecated") @test @inferred(gamma(a)) ≈ factorial(a - one(a))
@test @inferred(gamma(a + one(a))) ≈ @test_logs (:warn, r"factorial.*is deprecated") factorial(a)
@test @inferred(logabsgamma(abs(a)))[1] ≈ log(gamma(abs(a)))
@test @inferred(digamma(a)) ≈ polygamma(0, a)
@test @inferred(digamma(invdigamma(a))) ≈ a + zero(a)
Expand Down