Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/pydantic/pydantic
/ Model
Class
Model
tests/test_main.py:59–61 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
57
def
test_success():
58
# same as below but defined here so class definition occurs inside the test
59
class
Model(BaseModel):
60
a: float
61
b: int = 10
62
63
m = Model(a=10.2)
64
assert m.a == 10.2
Callers
15
test_success
Function · 0.70
test_self_reference_cached_property_repr
Function · 0.70
test_default_factory_field
Function · 0.70
test_not_required
Function · 0.70
test_allow_extra
Function · 0.70
test_allow_extra_repr
Function · 0.70
test_assign_extra_no_validate
Function · 0.70
test_assign_extra_validate
Function · 0.70
test_model_property_attribute_error
Function · 0.70
test_extra_allowed
Function · 0.70
test_reassign_instance_method_with_extra_allow
Function · 0.70
test_extra_ignored
Function · 0.70
Calls
6
Field
Function · 0.90
ConfigDict
Class · 0.90
PrivateAttr
Function · 0.90
AfterValidator
Class · 0.90
StringConstraints
Class · 0.90
Sub
Class · 0.70
Tested by
15
test_success
Function · 0.56
test_self_reference_cached_property_repr
Function · 0.56
test_default_factory_field
Function · 0.56
test_not_required
Function · 0.56
test_allow_extra
Function · 0.56
test_allow_extra_repr
Function · 0.56
test_assign_extra_no_validate
Function · 0.56
test_assign_extra_validate
Function · 0.56
test_model_property_attribute_error
Function · 0.56
test_extra_allowed
Function · 0.56
test_reassign_instance_method_with_extra_allow
Function · 0.56
test_extra_ignored
Function · 0.56