-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: add typing to tests and reformat fixtures
- Loading branch information
Showing
13 changed files
with
93 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import pathlib | ||
|
||
import pytest | ||
from cogent3 import ArrayAlignment, load_aligned_seqs | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def DATA_DIR(): | ||
def DATA_DIR() -> pathlib.Path: | ||
return pathlib.Path(__file__).parent / "data" | ||
|
||
|
||
@pytest.fixture() | ||
def three_otu(DATA_DIR: pathlib.Path) -> ArrayAlignment: | ||
aln = load_aligned_seqs(DATA_DIR / "example.fasta", moltype="dna") | ||
aln = aln.take_seqs(["Human", "Rhesus", "Mouse"]) | ||
return aln.omit_gap_pos(allowed_gap_frac=0) | ||
|
||
|
||
@pytest.fixture() | ||
def four_otu(DATA_DIR: pathlib.Path) -> ArrayAlignment: | ||
aln = load_aligned_seqs(DATA_DIR / "example.fasta", moltype="dna") | ||
aln = aln.take_seqs(["Human", "Chimpanzee", "Rhesus", "Mouse"]) | ||
return aln.omit_gap_pos(allowed_gap_frac=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
from piqtree2.model import FreqType | ||
|
||
|
||
def test_number_of_descriptions(): | ||
def test_number_of_descriptions() -> None: | ||
assert len(FreqType) == len(FreqType._descriptions()) | ||
|
||
|
||
def test_descriptions_exist(): | ||
def test_descriptions_exist() -> None: | ||
for freq_type in FreqType: | ||
# Raises an error if description not present | ||
_ = freq_type.description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.