docstr: Verify that argument validation works as intended.
docstr_tok: ["Verify","that","argument","validation","works","as","intended","."]
code: def test_exceptions(self):
      """
      Verify that argument validation works as intended.
      """
      for xp, scp in [(cupy, cupyx.scipy), (np, scipy)]:
          with pytest.raises(ValueError, match="1-D array"):
              # x with dimension > 1
              scp.signal.peak_widths(xp.zeros((3, 4)), xp.ones(3))
          with pytest.raises(ValueError, match="1-D array"):
              # x with dimension < 1
              scp.signal.peak_widths(3, [0])
          with pytest.raises(ValueError, match="1-D array"):
              # peaks with dimension > 1
              scp.signal.peak_widths(
                  xp.arange(10), xp.ones((3, 2), dtype=xp.intp)
              )
          with pytest.raises(ValueError, match="1-D array"):
              # peaks with dimension < 1
              scp.signal.peak_widths(xp.arange(10), 3)
          with pytest.raises(ValueError, match="not a valid index"):
              # peak pos exceeds x.size
              scp.signal.peak_widths(xp.arange(10), [8, 11])
          with pytest.raises(ValueError, match="not a valid index"):
              # empty x with peaks supplied
              scp.signal.peak_widths([], [1, 2])
          with pytest.raises(ValueError, match="rel_height"):
              # rel_height is < 0
              scp.signal.peak_widths(
                  [0, 1, 0, 1, 0], [1, 3], rel_height=-1
              )
          with pytest.raises(TypeError, match="None"):
              # prominence data contains None
              scp.signal.peak_widths(
                  [1, 2, 1], [1], prominence_data=(None, None, None)
              )
  
imports: import pytest
  import cupy
  from cupy.cuda import driver
  from cupy.cuda import runtime
  from cupy import testing
  import cupyx.scipy.signal
  import numpy
label_desc: Use image node_id 4 for calling the TestPeakWidths obj's underlying member method code with example usage: obj.test_exceptions() without return types