Skip to content

Commit 74d2de5

Browse files
committed
Add skip condition for tests requiring hl.qgamma
- Added a skip condition to the `test_gamma_returns_lower_and_upper` and `test_gamma_and_poisson_give_similar_results` methods in `test_constraint.py` to ensure compatibility with Hail versions that do not support `hl.qgamma`.
1 parent 8efabe3 commit 74d2de5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/utils/test_constraint.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
class TestOeConfidenceInterval:
2323
"""Test the oe_confidence_interval function."""
2424

25+
@pytest.mark.skipif(
26+
not hasattr(hl, "qgamma"), reason="hl.qgamma requires Hail >= 0.2.137"
27+
)
2528
def test_gamma_returns_lower_and_upper(self):
2629
"""Test that gamma method returns a struct with lower < upper."""
2730
ht = hl.Table.parallelize(
@@ -64,6 +67,9 @@ def test_invalid_method_raises(self):
6467
with pytest.raises(ValueError, match="Unknown CI method"):
6568
ht.annotate(ci=oe_confidence_interval(ht.obs, ht.exp, method="invalid"))
6669

70+
@pytest.mark.skipif(
71+
not hasattr(hl, "qgamma"), reason="hl.qgamma requires Hail >= 0.2.137"
72+
)
6773
def test_gamma_and_poisson_give_similar_results(self):
6874
"""Test that gamma and poisson methods give roughly similar CIs."""
6975
ht = hl.Table.parallelize(

0 commit comments

Comments
 (0)