code: def test_rejection_type(val, validator):
      with pytest.raises(ValueError) as validation_failure:
          validator.validate_coerce(val)
  
      assert "Invalid value" in str(validation_failure.value)
  
file_path: plotly.py/packages/python/plotly/_plotly_utils/tests/validators/test_colorscale_validator.py
imports: import pytest
  from _plotly_utils.basevalidators import ColorscaleValidator
  from _plotly_utils import colors
  import numpy
  import inspect
  import itertools
label_desc: Use image node_id 8 for calling a global function with example usage: test_rejection_type(val, validator) without return types