code: def test_bar_color_and_cmap_error_raises():
      df = DataFrame({"A": [1, 2, 3, 4]})
      msg = "`color` and `cmap` cannot both be given"
      # Test that providing both color and cmap raises a ValueError
      with pytest.raises(ValueError, match=msg):
          df.style.bar(color="#d65f5f", cmap="viridis").to_html()
  
imports: import io
  import numpy
  import pytest
  from pandas import NA, DataFrame, read_csv
label_desc: Use image node_id 18 for calling a global function with example usage: test_bar_color_and_cmap_error_raises() without return types