Skip to content

Commit ae95ed1

Browse files
author
Ryan P Kilby
committed
Add repr(value) to the assert msg in FieldValues
1 parent 71ad99e commit ae95ed1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_fields.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ def test_valid_inputs(self):
533533
Ensure that valid values return the expected validated data.
534534
"""
535535
for input_value, expected_output in get_items(self.valid_inputs):
536-
assert self.field.run_validation(input_value) == expected_output
536+
assert self.field.run_validation(input_value) == expected_output, \
537+
'input value: {}'.format(repr(input_value))
537538

538539
def test_invalid_inputs(self):
539540
"""
@@ -542,11 +543,13 @@ def test_invalid_inputs(self):
542543
for input_value, expected_failure in get_items(self.invalid_inputs):
543544
with pytest.raises(serializers.ValidationError) as exc_info:
544545
self.field.run_validation(input_value)
545-
assert exc_info.value.detail == expected_failure
546+
assert exc_info.value.detail == expected_failure, \
547+
'input value: {}'.format(repr(input_value))
546548

547549
def test_outputs(self):
548550
for output_value, expected_output in get_items(self.outputs):
549-
assert self.field.to_representation(output_value) == expected_output
551+
assert self.field.to_representation(output_value) == expected_output, \
552+
'output value: {}'.format(repr(output_value))
550553

551554

552555
# Boolean types...

0 commit comments

Comments
 (0)