class_docstr: Test suite for generate_discrete_swarm() method
class_docstr_tok: ["Test","suite","for","generate_discrete_swarm","(",")","method"]
docstr: Test if method raises ValueError given wrong init_pos val
docstr_tok: ["Test","if","method","raises","ValueError","given","wrong","init_pos","val"]
code: def test_not_binary_error_discrete_swarm(self):
      """Test if method raises ValueError given wrong init_pos val"""
      init_pos = [0, 1, 2]
      with pytest.raises(ValueError):
          P.generate_discrete_swarm(
              n_particles=2,
              dimensions=3,
              binary=True,
              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 TestDiscreteSwarm obj's underlying member method code with example usage: obj.test_not_binary_error_discrete_swarm() without return types