Skip to content

Commit

Permalink
TST: add match parameter to capture ParseIqTreeError explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
YapengLang committed Nov 8, 2024
1 parent 9262900 commit cca1aa8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_iqtree/test_tree_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,19 @@ def test_non_lie_dna_model_motif_absent(
non_lie_dna_with_rate_model: dict[str, Any],
) -> None:
non_lie_dna_with_rate_model["ModelDNA"].pop("state_freq")
with pytest.raises(ParseIqTreeError):
with pytest.raises(ParseIqTreeError, match=re.escape("IQ-TREE output malformated, motif parameters not found.")):
_ = _process_tree_yaml(non_lie_dna_with_rate_model, ["a", "b", "c", "d"])


def test_non_lie_dna_model_rate_absent(
non_lie_dna_with_rate_model: dict[str, Any],
) -> None:
non_lie_dna_with_rate_model["ModelDNA"].pop("rates")
with pytest.raises(ParseIqTreeError):
with pytest.raises(ParseIqTreeError,match=re.escape("IQ-TREE output malformated, rate parameters not found.")):
_ = _process_tree_yaml(non_lie_dna_with_rate_model, ["a", "b", "c", "d"])



def test_lie_dna_model(
lie_dna_model: dict[str, Any],
) -> None:
Expand All @@ -214,7 +215,7 @@ def test_lie_dna_model_motif_absent(
lie_dna_model: dict[str, Any],
) -> None:
lie_dna_model["ModelLieMarkovRY2.2b"].pop("state_freq")
with pytest.raises(ParseIqTreeError):
with pytest.raises(ParseIqTreeError, match=re.escape("IQ-TREE output malformated, motif parameters not found.")):
_ = _process_tree_yaml(lie_dna_model, ["a", "b", "c", "d"])


Expand Down

0 comments on commit cca1aa8

Please sign in to comment.