def test_type_enforce_exceptions(type_spec, value): entry = EntryInfo(enforce=type_spec) with pytest.raises(ValueError): entry.enforce_value(value)
def test_type_enforce_ok(type_spec, value, expected): entry = EntryInfo(enforce=type_spec) assert entry.enforce_value(value) == expected