Home / Function/ test_omitted_fields() — anthropic-sdk-python Function Reference

test_omitted_fields() — anthropic-sdk-python Function Reference

Architecture documentation for the test_omitted_fields() function in test_models.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  f9172ab8_2c38_eb7e_25dd_287846317b82["test_omitted_fields()"]
  7872e60b_4210_5600_119f_c5d08c52091e["test_models.py"]
  f9172ab8_2c38_eb7e_25dd_287846317b82 -->|defined in| 7872e60b_4210_5600_119f_c5d08c52091e
  style f9172ab8_2c38_eb7e_25dd_287846317b82 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_models.py lines 490–504

def test_omitted_fields() -> None:
    class Model(BaseModel):
        resource_id: Optional[str] = None

    m = Model.construct()
    assert m.resource_id is None
    assert "resource_id" not in m.model_fields_set

    m = Model.construct(resource_id=None)
    assert m.resource_id is None
    assert "resource_id" in m.model_fields_set

    m = Model.construct(resource_id="foo")
    assert m.resource_id == "foo"
    assert "resource_id" in m.model_fields_set

Subdomains

Frequently Asked Questions

What does test_omitted_fields() do?
test_omitted_fields() is a function in the anthropic-sdk-python codebase, defined in tests/test_models.py.
Where is test_omitted_fields() defined?
test_omitted_fields() is defined in tests/test_models.py at line 490.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free