Skip to content

Commit

Permalink
last test and suppress caught warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane committed Oct 17, 2024
1 parent e3cf823 commit 05ad10b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/unit/test_rsmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def test_has_uncertainties(noise_free_map: Map) -> None:
assert not noise_free_map.has_uncertainties


@pytest.mark.filterwarnings("ignore:Pandas doesn't allow columns to be created via a new attribute")
def test_set_uncertainties() -> None:
test_map = Map.from_dict(
{"F": rs.DataSeries([2.0, 3.0, 4.0]), "PHI": rs.DataSeries([0.0, 0.0, 0.0])},
Expand All @@ -197,6 +198,7 @@ def test_set_uncertainties() -> None:
with pytest.raises(AttributeError):
_ = test_map.uncertainties

# this would normally generate the suppressed warning, but we are more strict and raise
with pytest.raises(AttributeError):
test_map.uncertainties = rs.DataSeries([2.0, 3.0, 4.0])

Expand Down
7 changes: 7 additions & 0 deletions test/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def test_filter_common_indices() -> None:
assert len(filtered_df2) == 2


def test_filter_common_indices_empty_intersection() -> None:
df1 = pd.DataFrame({"A": [1, 2, 3]}, index=[0, 1, 2])
df2 = pd.DataFrame({"B": [4, 5, 6]}, index=[4, 5, 6])
with pytest.raises(IndexError):
_, _ = utils.filter_common_indices(df1, df2)


@pytest.mark.parametrize(
("dmax_limit", "dmin_limit"),
[
Expand Down

0 comments on commit 05ad10b

Please sign in to comment.