Skip to content

Commit 3fbc7b5

Browse files
committed
fix tests
1 parent e94a6c5 commit 3fbc7b5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

integration_tests/tests/test_dimension_anomalies.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ def test_anomalous_dimension_anomalies(test_id: str, dbt_project: DbtProject):
8686
}
8787
for superhero in ["Superman", "Superman", "Superman", "Spiderman"]
8888
]
89+
90+
test_result = dbt_project.test(test_id, DBT_TEST_NAME, DBT_TEST_ARGS, data=data)
91+
92+
assert test_result["status"] == "pass"
93+
94+
anomaly_test_points = get_latest_anomaly_test_points(dbt_project, test_id)
95+
assert len(anomaly_test_points) == 0
96+
8997
data += [
9098
{
9199
TIMESTAMP_COLUMN: cur_date.strftime(DATE_FORMAT),
@@ -98,10 +106,9 @@ def test_anomalous_dimension_anomalies(test_id: str, dbt_project: DbtProject):
98106
test_result = dbt_project.test(test_id, DBT_TEST_NAME, DBT_TEST_ARGS, data=data)
99107
assert test_result["status"] == "fail"
100108

101-
# Dimension anomalies only stores anomalous rows (unlike other anomaly tests) - so we should only get 1 row with the problematic value
102109
anomaly_test_points = get_latest_anomaly_test_points(dbt_project, test_id)
103110

104-
# Only dimension values that are anomalous are stored in the test points
111+
# Only test with anomalies are stored in the test points
105112
dimension_values = set([x["dimension_value"] for x in anomaly_test_points])
106113
assert len(dimension_values) == 2
107114
assert "Superman" in dimension_values
@@ -117,7 +124,7 @@ def test_anomalous_dimension_anomalies(test_id: str, dbt_project: DbtProject):
117124
x for x in anomaly_test_points if x["dimension_value"] == "Spiderman"
118125
]
119126
assert len(spiderman_anomaly_test_points) == 13
120-
assert any(x["is_anomalous"] for x in spiderman_anomaly_test_points)
127+
assert not any(x["is_anomalous"] for x in spiderman_anomaly_test_points)
121128

122129

123130
# Anomalies currently not supported on ClickHouse

0 commit comments

Comments
 (0)