  
          def raise_exception(value):
              raise exceptions.ValidationError('Raised error')
  
          for validators in ([raise_exception], (raise_exception,), set([raise_exception])):
              field = serializers.CharField(validators=validators)
              with pytest.raises(serializers.ValidationError) as exc_info:
                  field.run_validation(value)
              assert exc_info.value.detail == ['Raised error']
  
 
</s> remove         for validators in ([raise_exception], (raise_exception,), set([raise_exception])):
 </s> add         for validators in ([raise_exception], (raise_exception,), {raise_exception}): </s> remove         assert field.run_validation(1) is 1
 </s> add         assert field.run_validation(1) == 1 </s> remove         class ExampleInstance(object):
 </s> add         class ExampleInstance: </s> remove         assert response.content == six.b('')
 </s> add         assert response.content == b'' </s> remove class BadType(object):
 </s> add class BadType:
        for validators in ([raise_exception], (raise_exception,), {raise_exception}):
  
          def raise_exception(value):
              raise exceptions.ValidationError('Raised error')
  
        for validators in ([raise_exception], (raise_exception,), {raise_exception}):
              field = serializers.CharField(validators=validators)
              with pytest.raises(serializers.ValidationError) as exc_info:
                  field.run_validation(value)
              assert exc_info.value.detail == ['Raised error']
  
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
tests/test_fields.py