class_docstr: Test suite for generate_swarm() method
class_docstr_tok: ["Test","suite","for","generate_swarm","(",")","method"]
docstr: Test if method raises ValueError when initialized with the wrong value
docstr_tok: ["Test","if","method","raises","ValueError","when","initialized","with","the","wrong","value"]
code: def test_out_of_bounds(self):
      """Test if method raises ValueError when initialized with the wrong value"""
      bounds = ([1, 1, 1], [5, 5, 5])
      init_pos = np.array([[-2, 3, 3], [6, 8, 1]])
      with pytest.raises(ValueError):
          P.generate_swarm(
              n_particles=2,
              dimensions=3,
              bounds=bounds,
              init_pos=init_pos,
          )
  
file_path: pyswarms/tests/backend/test_generators.py
imports: import numpy
  import pytest
  import pyswarms.backend
label_desc: Use image node_id 2 for calling the TestGenerateSwarm obj's underlying member method code with example usage: obj.test_out_of_bounds() without return types