Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,274 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,274
◇
Types & classes
3,937
↳
Endpoints
46
Method
test_handle_async_is_passthrough
(self)
tests/test_middleware.py:510
Method
test_handle_is_passthrough
(self)
tests/test_middleware.py:498
Function
test_handle_item_falls_back_to_env_vars
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:690
Function
test_handle_item_falls_back_to_work_secret_env_var
`work_secret` falls back to `ANTHROPIC_WORK_SECRET` (the env var the `worker poll --on-work` command sets alongside the others); when neither
tests/lib/environments/test_worker.py:776
Function
test_handle_item_keyless_with_a_tokenless_secret_raises
A work secret that yields no sessions token, with no environment key to fall back to, must not run the item unauthenticated: the error names both
tests/lib/environments/test_worker.py:860
Function
test_handle_item_missing_required_raises
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:804
Function
test_handle_item_runs_keyless_on_a_token_bearing_secret
With no environment key anywhere — argument, constructor, or env var — a work secret whose payload carries a sessions token is credential enough:
tests/lib/environments/test_worker.py:833
Function
test_handle_item_services_a_single_claimed_item
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:622
Function
test_handle_item_stops_the_item_of_a_terminated_session
A terminated session accepts no tool result, so the worker starts no tool runner for it and force-stops the work item. It does so even when the se
tests/lib/environments/test_worker.py:664
Function
test_handle_item_uses_constructor_environment_key
`environment_key` resolves to the worker's own key when not passed and no env var is set.
tests/lib/environments/test_worker.py:721
Function
test_handle_item_uses_work_secret_argument
An explicit `work_secret` payload supplies the per-item Bearer credential (its sessions token); an `environment_key` passed alongside it is on
tests/lib/environments/test_worker.py:746
Method
test_handles_null_body
(self)
tests/lib/test_aws_auth.py:526
Method
test_hardcoded_query_params_in_url
(self, client: Anthropic)
tests/test_client.py:671
Method
test_hardcoded_query_params_in_url
(self, async_client: AsyncAnthropic)
tests/test_client.py:2107
Function
test_has_all_resources
()
tests/lib/test_aws.py:400
Method
test_headers_default_to_empty_mapping
(self)
tests/test_middleware.py:403
Function
test_heartbeat_412_releases_item_without_stopping_it
A 412 on the heartbeat means the server cleared this worker's lease (re-queued the item, or another worker holds it). The run ends, the item i
tests/lib/environments/test_worker.py:487
Function
test_heartbeat_conflict_is_retried_until_the_lease_is_stale
( monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/environments/test_worker.py:1144
Function
test_heartbeat_keeps_beating_while_a_sync_tool_blocks
Heartbeat loop and tool call share one task group, as they do in `_handle_item`.
tests/lib/environments/test_worker.py:1186
Function
test_heartbeat_permanent_4xx_stops_immediately
( monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/environments/test_worker.py:1174
Function
test_heartbeat_starts_before_skill_download
Regression: the lease heartbeat must already be running while skills are downloaded. Skill setup (`AgentToolContext.__aenter__`) can take lon
tests/lib/environments/test_worker.py:1004
Function
test_heartbeat_stop_still_force_stops
A heartbeat reporting `state == "stopped"` ends the run and the item is still force-stopped on the way out — only a *lost* lease skips that.
tests/lib/environments/test_worker.py:529
Function
test_heartbeat_that_never_returns_is_cut_off_each_interval
( monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/environments/test_worker.py:1162
Function
test_held_ask_call_does_not_block_other_dispatches
Holding an ask-gated call must not stall the rest of the queue: an ungated call arriving after it executes immediately, and the gated call fol
tests/lib/tools/test_session_runner.py:950
Function
test_held_ask_call_keeps_runner_alive
While a call awaits its confirmation the runner must keep running — even if history (defensively) ends on an `end_turn` idle — so the verdict
tests/lib/tools/test_session_runner.py:822
Method
test_held_response_stays_open
(self, client: Anthropic, held: Held[Any, Any])
tests/test_streaming.py:231
Method
test_held_response_stays_open
(self, async_client: AsyncAnthropic, held: AsyncHeld[Any, Any])
tests/test_streaming.py:279
Function
test_helper_header
()
tests/lib/test_stainless_helpers.py:32
Function
test_helper_header_is_an_append_header
()
tests/lib/test_stainless_helpers.py:36
Function
test_holds_a_call_that_is_deferred
(setup: SetupFactory, at: str)
tests/lib/tools/test_runner_eager_tools.py:405
Function
test_holds_a_call_that_the_caller_defers_until_the_loop_body_ends
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:82
Method
test_http_4xx_does_not_retain_assertion
(self)
tests/lib/test_credentials.py:4889
Method
test_http_base_url_in_config_file_raises_anthropic_error
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4049
Method
test_http_base_url_on_workload_provider_raises_anthropic_error
(self)
tests/lib/test_credentials.py:4040
Method
test_http_base_url_rejected
(self)
tests/lib/test_credentials.py:3305
Method
test_http_client_timeout_option
(self)
tests/test_client.py:364
Method
test_http_client_timeout_option
(self)
tests/test_client.py:1794
Method
test_httpx_objects_rejected
(self, client: Anthropic)
tests/test_client.py:500
Method
test_httpx_objects_rejected
(self, async_client: AsyncAnthropic)
tests/test_client.py:1932
Function
test_idempotent_and_does_not_mutate_input
( send: Send, make_body: Callable[[], object], sent: object, monkeypatch: pytest.MonkeyPatch )
tests/test_prepare.py:714
Method
test_identity_token_file_binary_content_raises_anthropic_error
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:4088
Method
test_identity_token_file_directory_raises_anthropic_error
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:4081
Method
test_identity_token_file_empty_raises_anthropic_error
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:4096
Method
test_identity_token_file_permission_error_raises_anthropic_error
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:4065
Method
test_identity_token_provider_override
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:3171
Function
test_idle_after_turn_ends_ends_iteration
(stop_reason: str, in_history: bool)
tests/lib/tools/test_session_runner.py:1259
Function
test_idle_grace_does_not_fire_without_end_turn
()
tests/lib/tools/test_session_runner.py:1287
Function
test_idle_stop_after_failed_history_read
After a failed history read, the runner drops the call of a terminated thread and stops on the idle countdown once a new idle or a whole read show
tests/lib/tools/test_session_runner.py:1739
Method
test_ids_in_the_path
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:7317
Function
test_ignores_incorrect_paths
( query: dict[str, object], paths: Sequence[Sequence[str]], expected: list[tuple[str, FileTypes]],
tests/test_extract_files.py:65
Method
test_image_content_gif
(self)
tests/lib/tools/test_mcp_tool.py:104
Method
test_image_content_jpeg
(self)
tests/lib/tools/test_mcp_tool.py:97
Method
test_image_content_png
(self)
tests/lib/tools/test_mcp_tool.py:89
Method
test_image_content_webp
(self)
tests/lib/tools/test_mcp_tool.py:108
Function
test_image_media_types_track_the_generated_image_source
()
tests/lib/tools/toolsets/test_computer_surface.py:99
Method
test_image_resource
(self)
tests/lib/tools/test_mcp_tool.py:230
Method
test_image_unsupported_mime_type
(self)
tests/lib/tools/test_mcp_tool.py:112
Method
test_includes_query_params_in_signing
URL query params must be part of the signed request.
tests/lib/test_aws_auth.py:541
Method
test_includes_security_token_header
(self)
tests/lib/test_aws_auth.py:490
Method
test_incomplete_response
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:867
Function
test_init_api_key_mode
()
tests/lib/test_aws.py:26
Function
test_init_async_api_key_mode
()
tests/lib/test_aws.py:75
Function
test_init_async_requires_workspace_id
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:91
Function
test_init_async_sigv4
()
tests/lib/test_aws.py:81
Function
test_init_requires_region_for_sigv4
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:57
Function
test_init_requires_workspace_id
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:63
Function
test_init_sigv4_default_credential_chain
()
tests/lib/test_aws.py:51
Function
test_init_sigv4_explicit_creds
()
tests/lib/test_aws.py:32
Function
test_init_sigv4_profile
()
tests/lib/test_aws.py:45
Method
test_init_with_token_provider_and_base_url
(self)
tests/lib/test_google_cloud.py:117
Function
test_init_workspace_id_from_env
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:69
Method
test_initialization_from_environment_variables
Test client initialization falls back to environment variables.
tests/lib/test_azure.py:53
Method
test_initialization_from_environment_variables
Test async client initialization falls back to environment variables.
tests/lib/test_azure.py:153
Method
test_initialization_with_azure_ad_token_provider
Test client initialization with Azure AD token provider.
tests/lib/test_azure.py:39
Method
test_initialization_with_base_url
Test client initialization with base_url instead of resource.
tests/lib/test_azure.py:30
Method
test_input_messages_under_the_bound_are_the_json_of_the_whole_list
( self, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:6451
Method
test_input_transformations_propagated
( self, respx_mock: MockRouter, fixture: str, expected: List[Dict[str, str]] )
tests/lib/streaming/test_beta_messages.py:678
Method
test_input_transformations_propagated
( self, respx_mock: MockRouter, fixture: str, expected: List[Dict[str, str]] )
tests/lib/streaming/test_beta_messages.py:1003
Function
test_inputs_are_parsed_into_the_generated_models_and_undeclared_keys_are_kept
()
tests/lib/tools/toolsets/test_computer_pipeline.py:148
Method
test_insert
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:320
Method
test_insert
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:946
Method
test_insert_at_beginning_of_file
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:337
Method
test_insert_at_beginning_of_file
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:963
Method
test_insert_at_end_of_file
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:353
Method
test_insert_at_end_of_file
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:981
Method
test_insert_error_for_invalid_insert_line
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:418
Method
test_insert_error_for_invalid_insert_line
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1054
Method
test_insert_error_for_non_existent_file
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:406
Method
test_insert_error_for_non_existent_file
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1042
Method
test_insert_preserves_crlf_line_endings
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:393
Method
test_insert_preserves_crlf_line_endings
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1027
Function
test_int_to_float_safe_conversion
()
tests/test_models.py:468
Function
test_integer_schema_with_min_max_exclusive
()
tests/lib/_parse/test_transform.py:232
Function
test_interpolation
(template: str, kwargs: dict[str, Any], expected: str)
tests/test_utils/test_path.py:63
Method
test_invalid_expires_in_does_not_retain_minted_token
(self, expires_in: str)
tests/lib/test_credentials.py:4896
Method
test_invalid_http_client
(self)
tests/test_client.py:490
Method
test_invalid_http_client
(self)
tests/test_client.py:1922
Method
test_invalid_json_credentials_does_not_retain_raw_text
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:5097
Method
test_invalid_profile_name_raises_anthropic_error
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4024
Method
test_invalidate
(self)
tests/lib/test_credentials.py:1718
← previous
next →
6,401–6,500 of 12,274, ranked by callers