def test_bad_distribution_name(four_by_four_raster): with pytest.raises(ValueError): random(four_by_four_raster, "values", "node", distribution="not_a_distribution")