abseil / abseil-py

Abseil Common Libraries (Python)
Apache License 2.0
2.27k stars 246 forks source link

Clarify the format of `assertDictEqual` different entries message #283

Closed copybara-service[bot] closed 2 months ago

copybara-service[bot] commented 3 months ago

Clarify the format of assertDictEqual different entries message

From the "repr() of differing entries" error message it is not immediately clear which value is expected, and which is actual. This PR clarifies the format in which different entries are printed in the repr() of differing entries section by appending (expected != actual) to it.

Example:

# Before
repr() of differing entries:
'csm_remote_workload_namespace_name': 'psm-csm-server-20240603-2018-ac5j0' != 'unknown'

# After
repr() of differing entries (expected != actual):
'csm_remote_workload_namespace_name': 'psm-csm-server-20240603-2018-ac5j0' != 'unknown'