Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Nov 14, 2024
1 parent 41c803d commit 3a6c0db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def test_quality_report_with_errors():
None,
],
})
assert score == 0.7249603174603174
assert score == 0.7249603174603175
pd.testing.assert_frame_equal(properties, expected_properties)
pd.testing.assert_frame_equal(details_column_shapes, expected_details)

Expand Down
14 changes: 14 additions & 0 deletions tests/unit/column_pairs/statistical/test_contingency_similarity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import patch

import pandas as pd
import pytest

from sdmetrics.column_pairs.statistical import ContingencySimilarity

Expand Down Expand Up @@ -53,3 +54,16 @@ def test_normalize(self, normalize_mock):
# Assert
normalize_mock.assert_called_once_with(raw_score)
assert result == normalize_mock.return_value

@pytest.mark.filterwarnings('error:.*The values in the array are unorderable.*:RuntimeWarning')
def test_no_warning_raised(self):
"""Test that no warning is raised when the metric is instantiated."""
# Setup
real_data = pd.DataFrame(data={'A': ['value'] * 4, 'B': ['1', '2', '3', pd.NA]})

synthetic_data = pd.DataFrame(data={'A': ['value'] * 3, 'B': ['1', '2', pd.NA]})

# Run and Assert
ContingencySimilarity.compute(
real_data=real_data[['A', 'B']], synthetic_data=synthetic_data[['A', 'B']]
)

0 comments on commit 3a6c0db

Please sign in to comment.