def test_parameter_arg_errors(): with pytest.raises(ValueError, match="'name' must be a string"): params.Parameter(123, default=None) # not string with pytest.raises(ValueError, match="'optional' must be boolean"): params.Parameter("o", default=None, optional="NotABool") with pytest.raises(ValueError, match="'readonly' must be boolean"): params.Parameter("o", default=None, readonly="NotABool")
class Test(object): p = params.Parameter('p', default=1, readonly=False) r = params.Parameter('r', default=None, readonly=True)
class Test(object): m = params.Parameter('m', default=1, optional=False) o = params.Parameter('o', default=1, optional=True)
class Test(object): p = params.Parameter('p', default=1)
class Test: param = params.Parameter("param", default=None)
class Test: o = params.Parameter("o", default=None)
class Test: p = params.Parameter("something", params.Unconfigurable)
def test_parameter_set_default_error(): """Tests params set_default ConfigError""" my_param = params.Parameter("something") with pytest.raises(ConfigError, match="Parameter.*is not configurable"): params.Parameter.set_default(my_param, my_param, my_param)
class Test: p = params.Parameter("p", default=1, readonly=False) r = params.Parameter("r", default=None, readonly=True)
class Test: m = params.Parameter("m", default=1, optional=False) o = params.Parameter("o", default=1, optional=True)
class Test: p = params.Parameter("p", default=1)
class Test(object): p = params.Parameter(default=1, readonly=True)
class Test: p = params.Parameter('p', default=1)