Skip to content

Commit

Permalink
Add key as error message in assert_dataset for floating value cases.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 557644482
  • Loading branch information
SeqIO Team authored and SeqIO committed Aug 16, 2023
1 parent 5122776 commit 6594a3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion seqio/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,9 @@ def _compare_dict(actual_dict, expected_dict):
or isinstance(actual_value, np.ndarray)
and np.issubdtype(actual_value.dtype, np.floating)
):
np.testing.assert_allclose(actual_value, expected_dict[key])
np.testing.assert_allclose(
actual_value, expected_dict[key], err_msg=key
)
else:
np.testing.assert_array_equal(
actual_value, _maybe_as_bytes(expected_dict[key]), key
Expand Down

0 comments on commit 6594a3c

Please sign in to comment.