Skip to content

Commit

Permalink
tests: adjust to new warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Apr 6, 2024
1 parent 1b1026f commit 598ff0f
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/integration/test_bracken_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def other_profile(data_dir: Path, request: pytest.FixtureRequest) -> Path:
),
],
)
@pytest.mark.filterwarnings("error")
def test_bracken_etl(
bracken_data_dir: Path,
filename: str,
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/test_diamond_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from pathlib import Path

import pytest
from pandas.errors import ParserError
from pandera.errors import SchemaErrors

from taxpasta.application.error import StandardisationError
Expand Down Expand Up @@ -60,11 +61,11 @@ def other_profile(data_dir: Path, request: pytest.FixtureRequest) -> Path:
"diamond_valid_2.tsv",
pytest.param(
"diamond_invalid_1.tsv",
marks=pytest.mark.raises(exception=SchemaErrors),
marks=pytest.mark.raises(exception=ParserError),
),
pytest.param(
"diamond_invalid_2.tsv",
marks=pytest.mark.raises(exception=SchemaErrors),
marks=pytest.mark.raises(exception=ParserError),
),
],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_ganon_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def other_profile(data_dir: Path, request: pytest.FixtureRequest) -> Path:
"2612_pe_ERR5766176_db1.ganon.tre",
pytest.param(
"invalid_2612_pe_ERR5766176_db1.ganon_missing_column.tre",
marks=pytest.mark.raises(exception=SchemaErrors),
marks=pytest.mark.raises(exception=ValueError),
),
],
)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_kaiju_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def other_profile(data_dir: Path, request: pytest.FixtureRequest) -> Path:
),
],
)
@pytest.mark.filterwarnings("error")
def test_kaiju_etl(
kaiju_data_dir: Path,
filename: str,
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_kraken2_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def other_profile(data_dir: Path, request: pytest.FixtureRequest) -> Path:
),
],
)
@pytest.mark.filterwarnings("error")
def test_kraken2_etl(
kraken2_data_dir: Path,
filename: str,
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_metaphlan_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def test_valid_profile_etl(
)


@pytest.mark.filterwarnings("error")
def test_invalid_profile_etl(
invalid_metaphlan_profile: Path,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def test_column_presence(profile: pd.DataFrame):
),
],
)
@pytest.mark.filterwarnings("error")
def test_fraction_total_reads(profile: pd.DataFrame):
"""Test that the fraction column is checked."""
BrackenProfile.validate(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def test_column_presence(profile: pd.DataFrame):
),
],
)
@pytest.mark.filterwarnings("error")
def test_percent(profile: pd.DataFrame):
"""Test that the percent column is checked."""
CentrifugeProfile.validate(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_column_presence(profile: pd.DataFrame):
)
),
marks=pytest.mark.raises(
exception=SchemaError, message="check_compositionality"
exception=SchemaError, message="<Check compositionality>"
),
),
pytest.param(
Expand All @@ -148,11 +148,12 @@ def test_column_presence(profile: pd.DataFrame):
)
),
marks=pytest.mark.raises(
exception=SchemaError, message="check_compositionality"
exception=SchemaError, message="<Check compositionality>"
),
),
],
)
@pytest.mark.filterwarnings("error")
def test_percent(profile: pd.DataFrame):
"""Test that the percent column (percent_cumulative) is checked."""
GanonProfile.validate(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def test_column_presence(profile: pd.DataFrame):
),
],
)
@pytest.mark.filterwarnings("error")
def test_percent(profile: pd.DataFrame):
"""Test that the percent column is checked."""
KaijuProfile.validate(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def test_column_presence(profile: pd.DataFrame):
),
],
)
@pytest.mark.filterwarnings("error")
def test_percent(profile: pd.DataFrame):
"""Test that the percent column (percent_cumulative) is checked."""
KMCPProfile.validate(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def test_column_presence(profile: pd.DataFrame):
),
],
)
@pytest.mark.filterwarnings("error")
def test_percent(profile: pd.DataFrame):
"""Test that the percent column is checked."""
Kraken2Profile.validate(profile)
Expand Down

0 comments on commit 598ff0f

Please sign in to comment.