docstr: Test that population samplers check the population size.
docstr_tok: ["Test","that","population","samplers","check","the","population","size","."]
code: def test_checks_population_size(self):
      """Test that population samplers check the population size."""
      with pm.Model() as model:
          n = pm.Normal("n", mu=0, sigma=1)
          for stepper in TestPopulationSamplers.steppers:
              step = stepper()
              with pytest.raises(
                  ValueError, match="requires at least 3 chains"
              ):
                  pm.sample(
                      draws=10, tune=10, chains=1, cores=1, step=step
                  )
              # don't parallelize to make test faster
              pm.sample(
                  draws=10,
                  tune=10,
                  chains=4,
                  cores=1,
                  step=step,
                  compute_convergence_checks=False,
              )
  
file_path: pymc/tests/sampling/test_population.py
imports: import pytest
  import pymc
  from pymc.step_methods.metropolis import DEMetropolis
label_desc: Use image node_id 1 for calling the TestPopulationSamplers obj's underlying member method code with example usage: obj.test_checks_population_size() without return types