Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jlorincz/testing clarity #171

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions disruption_py/utils/eval/eval_against_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,16 @@ def eval_shot_against_sql(
missing_sql_data=missing_sql_data,
expect_failure=expect_failure,
)

if fail_quick and not (missing_mdsplus_data or missing_sql_data):
if expect_failure:
assert data_difference.failed, "Expected failure but succeeded:\n{}".format(
data_difference.column_mismatch_string
)
else:
assert (
not data_difference.failed
), "Expected success but failed:\n{}".format(
data_difference.column_mismatch_string
)
expectation = "failure" if expect_failure else "success"
failure = "failed" if data_difference.failed else "succeeded"
assert (
not data_difference.failed
), "Expected {expectation} and {failure}:\n{report}".format(
expectation=expectation,
failure=failure,
report=data_difference.column_mismatch_string,
)

return data_difference

Expand Down