Language: Python
Label: safe
CWE: CWE-209 \u2014 Generation of Error Message Containing Sensitive Information
The product generates an error message that includes sensitive information about its environment, users, or associated data.

Code:
def test_format_error_hides_internal_error_msg_in_production_mode():
    error = ValueError("Example error")
    result = format_error(error, ())
    assert result["message"] == INTERNAL_ERROR_MESSAGE