Skip to content

Commit

Permalink
MNT: Add new linters for checking print statement and pytest style. T…
Browse files Browse the repository at this point in the history
…hen, fix the raised issues. [skip ci]
  • Loading branch information
Taher Chegini committed Oct 7, 2023
1 parent 5bccdb7 commit a02f475
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.fixture(autouse=True)
def add_standard_imports(doctest_namespace):
def _add_standard_imports(doctest_namespace):
"""Add hydrosignatures namespace for doctest."""
import hydrosignatures as hs

Expand Down
6 changes: 3 additions & 3 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@


def test_same_input_length():
with pytest.raises(InputTypeError) as ex:
_ = hs.HydroSignatures(pd.Series(np.arange(10)), pd.Series(np.arange(11)))
assert "same length" in str(ex.value)
q_mmpt, p_mmpt = pd.Series(np.arange(10)), pd.Series(np.arange(11))
with pytest.raises(InputTypeError, match="same length"):
_ = hs.HydroSignatures(q_mmpt, p_mmpt)
4 changes: 2 additions & 2 deletions tests/test_hydrosignatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def assert_close(a: float, b: float) -> None:
assert np.isclose(a, b, rtol=1e-3).all()


@pytest.fixture
@pytest.fixture()
def datasets() -> Tuple[pd.Series, pd.Series, Dict[str, Any]]:
df = pd.read_csv(Path("tests", "test_data.csv"), index_col=0, parse_dates=True)
with Path("tests", "test_data.json").open("r") as f:
sig_expected = json.load(f)
return df.q_mmpd, df.p_mmpd, sig_expected


@pytest.mark.speedup
@pytest.mark.speedup()
def test_signatures(datasets):
q_mmpd, p_mmpd, sig_expected = datasets
sig = hs.HydroSignatures(q_mmpd, p_mmpd)
Expand Down

0 comments on commit a02f475

Please sign in to comment.