Skip to content

Commit

Permalink
add test for the warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Dec 18, 2020
1 parent f34990f commit 8010510
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_calculator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import pyhf
import pyhf.infer.calculators
import pytest
import logging


def test_calc_dist():
asymptotic_dist = pyhf.infer.calculators.AsymptoticTestStatDistribution(0.0)
assert asymptotic_dist.pvalue(-1) == 1 - asymptotic_dist.cdf(-1)


@pytest.mark.parametrize("calculator", ["asymptotics", "toybased"])
@pytest.mark.parametrize("qtilde", [True, False])
def test_deprecated_qtilde(caplog, mocker, calculator, qtilde):
with caplog.at_level(logging.WARNING):
pyhf.infer.utils.create_calculator(
calculator, ['fake data'], mocker.Mock(), qtilde=qtilde
)
assert "is deprecated. Use test_stat" in caplog.text

0 comments on commit 8010510

Please sign in to comment.