From 83ffc1e43d5a53cdacad77d89baf907059fac0ac Mon Sep 17 00:00:00 2001 From: Yan Wong Date: Mon, 24 Jul 2023 11:51:46 +0100 Subject: [PATCH] Add a minor extra tests --- tests/test_functions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_functions.py b/tests/test_functions.py index 81c9f968..297de811 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -1838,7 +1838,7 @@ def test_node_times(self): def test_fails_unconstrained(self): ts = utility_functions.two_tree_mutation_ts() - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="must be tsdated"): nodes_time_unconstrained(ts) @@ -1852,9 +1852,14 @@ def test_no_sites(self): with pytest.raises(ValueError): tsdate.sites_time_from_ts(ts) + def test_undated(self): + ts = utility_functions.two_tree_mutation_ts() + with pytest.raises(ValueError, match="Try calling"): + tsdate.sites_time_from_ts(ts, unconstrained=True) + def test_node_selection_param(self): ts = utility_functions.two_tree_mutation_ts() - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="node_selection parameter"): tsdate.sites_time_from_ts(ts, node_selection="sibling") def test_sites_time_insideoutside(self):