Skip to content

Commit

Permalink
tests: small fix to remove a confusing print statement and to clean u…
Browse files Browse the repository at this point in the history
…p code
  • Loading branch information
dbirman committed Jan 2, 2025
1 parent a1163c7 commit 4e97083
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions tests/test_quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_constructors(self):
stage=Stage.PROCESSING,
metrics=[
QCMetric(
name="Multiple values example",
name="Dict example",
value={"stuff": "in_a_dict"},
status_history=[
QCStatus(evaluator="Bob", timestamp=datetime.fromisoformat("2020-10-10"), status=Status.PASS)
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_overall_status(self):
stage=Stage.PROCESSING,
metrics=[
QCMetric(
name="Multiple values example",
name="Dict example",
value={"stuff": "in_a_dict"},
status_history=[
QCStatus(evaluator="Bob", timestamp=datetime.fromisoformat("2020-10-10"), status=Status.PASS)
Expand Down Expand Up @@ -298,7 +298,7 @@ def test_multi_session(self):
stage=Stage.PROCESSING,
metrics=[
QCMetric(
name="Multiple values example",
name="Dict example",
value={"stuff": "in_a_dict"},
status_history=[
QCStatus(evaluator="Automated", timestamp=t0, status=Status.PASS),
Expand All @@ -318,7 +318,7 @@ def test_multi_session(self):
stage=Stage.PROCESSING,
metrics=[
QCMetric(
name="Multiple values example",
name="Dict with evaluated assets list",
value={"stuff": "in_a_dict"},
status_history=[
QCStatus(evaluator="Automated", timestamp=t0, status=Status.PASS),
Expand All @@ -327,11 +327,9 @@ def test_multi_session(self):
),
],
)

print(context.exception)
self.assertTrue(
"is in a single-asset QCEvaluation and should not have evaluated_assets" in repr(context.exception)
)
self.assertTrue(
"is in a single-asset QCEvaluation and should not have evaluated_assets" in repr(context.exception)
)

# Check that multi-asset with empty evaluated_assets raises a validation error
with self.assertRaises(ValidationError) as context:
Expand All @@ -341,7 +339,7 @@ def test_multi_session(self):
stage=Stage.MULTI_ASSET,
metrics=[
QCMetric(
name="Multiple values example",
name="Missing evaluated assets",
value={"stuff": "in_a_dict"},
status_history=[
QCStatus(evaluator="Automated", timestamp=t0, status=Status.PASS),
Expand All @@ -350,8 +348,7 @@ def test_multi_session(self):
),
],
)

self.assertTrue("is in a multi-asset QCEvaluation and must have evaluated_assets" in repr(context.exception))
self.assertTrue("is in a multi-asset QCEvaluation and must have evaluated_assets" in repr(context.exception))

# Check that multi-asset with missing evaluated_assets raises a validation error
with self.assertRaises(ValidationError) as context:
Expand All @@ -369,8 +366,7 @@ def test_multi_session(self):
),
],
)

self.assertTrue("is in a multi-asset QCEvaluation and must have evaluated_assets" in repr(context.exception))
self.assertTrue("is in a multi-asset QCEvaluation and must have evaluated_assets" in repr(context.exception))

def test_status_filters(self):
"""Test that QualityControl.status(modality, stage) filters correctly"""
Expand Down

0 comments on commit 4e97083

Please sign in to comment.