Skip to content

Commit

Permalink
Fix test warnings and a new failure from #36
Browse files Browse the repository at this point in the history
  • Loading branch information
reece committed May 4, 2022
1 parent ed6eaf6 commit 22b5556
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
14 changes: 10 additions & 4 deletions setup.cfg
Expand Up @@ -69,9 +69,13 @@ exclude =
dev =
ipython>=7.5
jupyter>=1.0
pytest
pytest-cov
pytest-optional-tests
pyyaml
restview
tox
vcrpy
yapf
docs =
sphinx
Expand Down Expand Up @@ -102,14 +106,16 @@ max-complexity = 10
ignore = E129,E221,E241,E251,E303,W291

[tool:pytest]
addopts = --cov-config=setup.cfg --cov-report term-missing --cov=bioutils --doctest-modules --doctest-glob='*.rst' --strict
collect_ignore = setup.py
addopts = --cov-config=setup.cfg --cov-report term-missing --cov=bioutils --doctest-modules --doctest-glob='*.rst' --strict-markers
# collect_ignore = setup.py
doctest_optionflags = ALLOW_UNICODE ALLOW_BYTES ELLIPSIS IGNORE_EXCEPTION_DETAIL NORMALIZE_WHITESPACE
norecursedirs =
_data
dist
build
.tox
testpaths = src tests
optional_tests =
network: run network tests
markers =
network
#optional_tests =
# network: run network tests
24 changes: 8 additions & 16 deletions tests/test_sequences.py
@@ -1,6 +1,6 @@
import pytest
from bioutils.sequences import translate_cds
from src.bioutils.sequences import TranslationTable
from bioutils.sequences import TranslationTable


def test_translate_examples():
Expand Down Expand Up @@ -29,21 +29,13 @@ def test_translate_examples():
def test_translate_selenoproteins():
"""unit test for sec codon"""
assert translate_cds("AUGTGATAA") == "M**"
assert (
translate_cds("AUGTGATAA", translation_table=TranslationTable.standard) == "M**"
)
assert (
translate_cds("AUGTGATAA", translation_table=TranslationTable.selenocysteine)
== "MU*"
)
assert (
translate_cds(
"AUGTGATA",
translation_table=TranslationTable.selenocysteine,
full_codons=False,
)
== "MU*"
)
assert (translate_cds("AUGTGATAA", translation_table=TranslationTable.standard) == "M**")
assert (translate_cds("AUGTGATAA", translation_table=TranslationTable.selenocysteine) == "MU*")
assert (translate_cds(
"AUGTGATA",
translation_table=TranslationTable.selenocysteine,
full_codons=False,
) == "MU*")

with pytest.raises(ValueError):
translate_cds("AUGTGATA", translation_table=TranslationTable.selenocysteine)

0 comments on commit 22b5556

Please sign in to comment.