From ae95ed1ec2514becb6e2e41d47b8fd3c8b9c8f66 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Mon, 11 Sep 2017 05:18:39 -0400 Subject: [PATCH] Add repr(value) to the assert msg in FieldValues --- tests/test_fields.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_fields.py b/tests/test_fields.py index c3d2bf57d..4173e6ab5 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -533,7 +533,8 @@ class FieldValues: Ensure that valid values return the expected validated data. """ for input_value, expected_output in get_items(self.valid_inputs): - assert self.field.run_validation(input_value) == expected_output + assert self.field.run_validation(input_value) == expected_output, \ + 'input value: {}'.format(repr(input_value)) def test_invalid_inputs(self): """ @@ -542,11 +543,13 @@ class FieldValues: for input_value, expected_failure in get_items(self.invalid_inputs): with pytest.raises(serializers.ValidationError) as exc_info: self.field.run_validation(input_value) - assert exc_info.value.detail == expected_failure + assert exc_info.value.detail == expected_failure, \ + 'input value: {}'.format(repr(input_value)) def test_outputs(self): for output_value, expected_output in get_items(self.outputs): - assert self.field.to_representation(output_value) == expected_output + assert self.field.to_representation(output_value) == expected_output, \ + 'output value: {}'.format(repr(output_value)) # Boolean types...