|
26 | 26 | """
|
27 | 27 | import collections
|
28 | 28 | import json
|
| 29 | +import logging |
29 | 30 | import unittest
|
30 | 31 |
|
31 | 32 | import msprime
|
@@ -457,9 +458,13 @@ def test_single_tree_ts_disallow_unary(self):
|
457 | 458 | with pytest.raises(ValueError, match="unary"):
|
458 | 459 | self.get_mixture_prior_params(ts, "gamma")
|
459 | 460 |
|
460 |
| - def test_single_tree_ts_with_unary(self): |
| 461 | + def test_single_tree_ts_with_unary(self, caplog): |
461 | 462 | ts = utility_functions.single_tree_ts_with_unary()
|
462 |
| - mixture_priors = self.get_mixture_prior_params(ts, "gamma", allow_unary=True) |
| 463 | + with caplog.at_level(logging.WARNING): |
| 464 | + mixture_priors = self.get_mixture_prior_params( |
| 465 | + ts, "gamma", allow_unary=True |
| 466 | + ) |
| 467 | + assert "tsdate may give poor results" in caplog.text |
463 | 468 | # Root is a 3 tip prior
|
464 | 469 | assert np.allclose(mixture_priors[7, self.alpha_beta], [1.6, 1.2])
|
465 | 470 | # Node 6 should be a 50:50 mixture between 1 and 3 tips
|
@@ -1093,8 +1098,8 @@ def test_two_tree_mutation_ts(self):
|
1093 | 1098 |
|
1094 | 1099 | def test_dangling_fails(self):
|
1095 | 1100 | ts = utility_functions.single_tree_ts_n2_dangling()
|
1096 |
| - print(ts.draw_text()) |
1097 |
| - print("Samples:", ts.samples()) |
| 1101 | + # print(ts.draw_text()) |
| 1102 | + # print("Samples:", ts.samples()) |
1098 | 1103 | Ne = 0.5
|
1099 | 1104 | with pytest.raises(ValueError, match="simplified"):
|
1100 | 1105 | tsdate.build_prior_grid(ts, Ne, timepoints=np.array([0, 1.2, 2]))
|
|
0 commit comments