Skip to content

Commit 3a6c0db

Browse files
committed
tests
1 parent 41c803d commit 3a6c0db

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/integration/reports/multi_table/test_quality_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def test_quality_report_with_errors():
342342
None,
343343
],
344344
})
345-
assert score == 0.7249603174603174
345+
assert score == 0.7249603174603175
346346
pd.testing.assert_frame_equal(properties, expected_properties)
347347
pd.testing.assert_frame_equal(details_column_shapes, expected_details)
348348

tests/unit/column_pairs/statistical/test_contingency_similarity.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest.mock import patch
22

33
import pandas as pd
4+
import pytest
45

56
from sdmetrics.column_pairs.statistical import ContingencySimilarity
67

@@ -53,3 +54,16 @@ def test_normalize(self, normalize_mock):
5354
# Assert
5455
normalize_mock.assert_called_once_with(raw_score)
5556
assert result == normalize_mock.return_value
57+
58+
@pytest.mark.filterwarnings('error:.*The values in the array are unorderable.*:RuntimeWarning')
59+
def test_no_warning_raised(self):
60+
"""Test that no warning is raised when the metric is instantiated."""
61+
# Setup
62+
real_data = pd.DataFrame(data={'A': ['value'] * 4, 'B': ['1', '2', '3', pd.NA]})
63+
64+
synthetic_data = pd.DataFrame(data={'A': ['value'] * 3, 'B': ['1', '2', pd.NA]})
65+
66+
# Run and Assert
67+
ContingencySimilarity.compute(
68+
real_data=real_data[['A', 'B']], synthetic_data=synthetic_data[['A', 'B']]
69+
)

0 commit comments

Comments
 (0)