def data_array_validator(request): return DataArrayValidator("prop", "parent")
def data_array_validator(request): return DataArrayValidator('prop', 'parent')
def validator(): return DataArrayValidator("prop", "parent")
def validator(): return DataArrayValidator('prop', 'parent')
def test_rejection(val, validator: DataArrayValidator): with pytest.raises(ValueError) as validation_failure: validator.validate_coerce(val) assert 'Invalid value' in str(validation_failure.value)
def test_validator_acceptance_homogeneous(val, validator: DataArrayValidator): coerce_val = validator.validate_coerce(val) assert isinstance(coerce_val, np.ndarray) assert np.array_equal(validator.present(coerce_val), val)
def test_validator_acceptance_simple(val, validator: DataArrayValidator): coerce_val = validator.validate_coerce(val) assert isinstance(coerce_val, list) assert validator.present(coerce_val) == tuple(val)