Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
9,455 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
9,455
◇
Types & classes
3,151
↳
Endpoints
25
Function
test_scoped_sub_client_sends_only_bearer_on_the_wire
Integration-level check: send a real HTTP request through the scoped sub-client (via `httpx2.MockTransport`) and inspect the headers actually
tests/lib/test_scoped_client.py:112
Function
test_screenshot_media_types_track_the_generated_image_source
()
tests/lib/tools/toolsets/test_surface.py:184
Function
test_screenshot_renders_one_image_block_as_returned
()
tests/lib/tools/toolsets/test_pipeline.py:164
Method
test_secret_key_only_raises
(self)
tests/lib/test_aws_auth.py:32
Method
test_secret_key_only_raises
(self)
tests/lib/test_bedrock_mantle.py:228
Function
test_secret_not_logged_on_error_paths
Error-path logging (heartbeat shutdown, force-stop failure) must not leak the per-item secret payload or its sessions token.
tests/lib/environments/test_worker.py:424
Method
test_selects_first_supported
(self)
tests/lib/tools/test_mcp_tool.py:244
Function
test_send_retries_past_three_attempts
A tool-result send that keeps failing transiently must keep retrying with backoff (not give up after three attempts while an enclosing worker keep
tests/lib/tools/test_session_runner.py:1343
Function
test_send_retry_window_update_bounds_send_already_retrying
A send retry window that changes while a send is already retrying bounds that send — `EnvironmentWorker` keeps it equal to the lease TTL each
tests/lib/tools/test_session_runner.py:1396
Function
test_sends_the_error_result_of_a_call_that_failed_while_the_reply_streamed
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:364
Method
test_sends_the_fallback_credit_beta_on_the_original_and_fallback_requests
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:577
Function
test_sequences_sets_views_and_iterators_are_sent_as_lists
(send: Send, make: Callable[[], object])
tests/test_prepare.py:257
Function
test_serialize_data
(sync: bool)
tests/test_prepare.py:345
Method
test_server_side_fallbacks_raise_an_error
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:526
Method
test_server_side_fallbacks_raise_an_error
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:612
Method
test_server_side_tool
( self, snapshot_client: Anthropic, )
tests/lib/tools/test_runners.py:505
Method
test_server_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:312
Method
test_server_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:537
Method
test_server_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:468
Method
test_server_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:734
Method
test_service_account_included
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1086
Function
test_session_runner_threads_extra_headers_into_stream_list_and_send
A caller-supplied `extra_headers` is threaded, unchanged, into every per-request call the runner makes: the event `stream`, the history `list`
tests/lib/tools/test_session_runner.py:1638
Function
test_sessions_token_from_secret
The secret payload decodes from URL-safe base64 JSON (with or without padding); anything malformed or token-less resolves to None.
tests/lib/environments/test_worker.py:404
Function
test_sets_bearer_auth_token_on_copy
()
tests/lib/test_scoped_client.py:18
Method
test_shadow_warning_is_one_shot_per_process
The shadow warning is emitted once per shadow-key per process so repeated client construction doesn't spam logs.
tests/lib/test_credentials.py:4291
Method
test_shared_provider_binds_per_client
The same isolation holds when one provider instance is passed to two clients directly: the first client keeps its binding.
tests/lib/test_credentials.py:2776
Method
test_short_circuit_skips_http_request
(self, respx_mock: MockRouter)
tests/test_middleware.py:757
Method
test_short_circuit_skips_http_request
(self, respx_mock: MockRouter)
tests/test_middleware.py:1493
Method
test_short_token_fully_masked
(self)
tests/lib/test_credentials.py:4360
Function
test_siblings_are_prepared_in_document_order
(send: Send, monkeypatch: pytest.MonkeyPatch)
tests/test_prepare.py:286
Function
test_signature_without_evaluating_annotations_tolerates_undefined_names
()
tests/test_utils/test_reflection.py:12
Function
test_sigv4_binary_file_upload
(sync: bool, respx_mock: MockRouter)
tests/lib/test_aws.py:522
Method
test_sigv4_ignores_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:241
Method
test_sigv4_mode_returns_empty_auth_headers
(self)
tests/lib/test_bedrock_mantle.py:190
Method
test_sigv4_signing_runs_off_event_loop
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:258
Function
test_sigv4_signing_runs_off_event_loop_async
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock.py:618
Function
test_sigv4_signing_runs_off_event_loop_async
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:801
Function
test_sigv4_signs_binary_body
(sync: bool, respx_mock: MockRouter)
tests/lib/test_bedrock.py:480
Function
test_sigv4_with_options_ignores_ambient_first_party_credentials
( sync: bool, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_aws.py:548
Function
test_skip_auth_async
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:183
Function
test_skip_auth_base_url_env_overrides_region
(client_cls: _AWSClientClass, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:168
Function
test_skip_auth_base_url_from_region_arg
(client_cls: _AWSClientClass, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:152
Function
test_skip_auth_base_url_from_region_env
(client_cls: _AWSClientClass, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:160
Method
test_skip_auth_derives_url_with_workspace
(self)
tests/lib/test_google_cloud.py:112
Method
test_skip_auth_derives_url_with_workspace
(self)
tests/lib/test_google_cloud.py:1097
Method
test_skip_auth_deriving_base_url_requires_project
(self)
tests/lib/test_google_cloud.py:101
Method
test_skip_auth_deriving_base_url_requires_project
(self)
tests/lib/test_google_cloud.py:1089
Method
test_skip_auth_deriving_base_url_requires_workspace
(self)
tests/lib/test_google_cloud.py:106
Method
test_skip_auth_deriving_base_url_requires_workspace
(self)
tests/lib/test_google_cloud.py:1093
Method
test_skip_auth_does_not_sign_request
(self, get_auth_headers_recorder: GetAuthHeadersRecorder)
tests/lib/test_bedrock_mantle.py:207
Function
test_skip_auth_explicit_auth_token_on_copy_is_sent
( sync: bool, via: str, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_aws.py:253
Function
test_skip_auth_explicit_base_url_wins
(client_cls: _AWSClientClass, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:176
Method
test_skip_auth_mutually_exclusive_with_credentials
(self)
tests/lib/test_google_cloud.py:166
Method
test_skip_auth_mutually_exclusive_with_credentials
(self)
tests/lib/test_google_cloud.py:1072
Function
test_skip_auth_no_auth_headers
(respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:192
Function
test_skip_auth_no_workspace_required
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:118
Function
test_skip_auth_region_request_url
( sync: bool, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_aws.py:217
Function
test_skip_auth_requires_region_or_base_url
(client_cls: _AWSClientClass, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:144
Method
test_skip_auth_returns_empty_auth_headers
(self)
tests/lib/test_bedrock_mantle.py:198
Function
test_skip_auth_sends_neither_header
(respx_mock: MockRouter)
tests/lib/test_google_cloud.py:819
Function
test_skipped_unowned_tool_does_not_trip_idle
A skipped (unanswered) unowned tool_use stays OUT of the end-turn accounting: reconcile sees history ending on an `end_turn` idle but with the
tests/lib/tools/test_session_runner.py:589
Function
test_skips_already_answered_custom_tool
A custom tool whose `user.custom_tool_result` is already in history (via reconcile) is not re-executed when the same `agent.custom_tool_use` is th
tests/lib/tools/test_session_runner.py:505
Function
test_skips_already_answered_events
Tool result already in history (via reconcile) should suppress re-execution of the same tool_use seen on the live stream.
tests/lib/tools/test_session_runner.py:402
Function
test_skips_unowned_builtin_and_custom_tools_by_default
Default split-client behavior: a tool-call event whose name is not in the runner's registry belongs to the other client servicing the session
tests/lib/tools/test_session_runner.py:530
Function
test_special_new_line_character
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, )
tests/test_streaming.py:169
Method
test_splices_the_fallback_onto_the_refused_stream
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:224
Method
test_splices_the_fallback_onto_the_refused_stream
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1593
Function
test_stamps_helper_telemetry_header
()
tests/lib/test_scoped_client.py:48
Function
test_starts_a_toolset_call_once_the_model_has_moved_on_from_it
(setup: SetupFactory, family: str)
tests/lib/tools/test_runner_eager_toolsets.py:82
Function
test_starts_javascript_exec_like_any_other_call
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_toolsets.py:184
Function
test_state_changes_are_told_apart_by_their_type
()
tests/lib/tools/toolsets/test_surface.py:134
Function
test_state_changes_pass_through_and_download_paths_stay_hidden_without_a_file_policy
()
tests/lib/tools/toolsets/test_pipeline.py:204
Function
test_static_aliases_agree_with_the_derived_tables
()
tests/lib/tools/toolsets/test_computer_registry.py:52
Function
test_static_aliases_agree_with_the_derived_tables
()
tests/lib/tools/toolsets/test_registry.py:73
Method
test_static_token_credentials
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:2421
Method
test_status_error_type_field
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1408
Method
test_status_error_type_field
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:2743
Function
test_stores_sync_in_parallel_and_one_failure_spares_the_rest
Stores sync concurrently, and one store's failure never blocks another. The slow store's listing waits for the fast store's listing to start —
tests/lib/tools/memory_sync/test_memory_sync.py:645
Method
test_str_replace
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:206
Method
test_str_replace
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:731
Method
test_str_replace_error_for_non_existent_file
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:280
Method
test_str_replace_error_for_non_existent_file
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:805
Method
test_str_replace_error_when_string_appears_multiple_times
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:256
Method
test_str_replace_error_when_string_appears_multiple_times
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:781
Method
test_str_replace_error_when_string_not_found
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:232
Method
test_str_replace_error_when_string_not_found
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:757
Method
test_str_replace_preserves_crlf_line_endings
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:355
Method
test_str_replace_preserves_crlf_line_endings
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:886
Method
test_str_variant
(self)
tests/test_utils/test_json.py:20
Method
test_stream_does_not_warn_for_type
`.stream(output_format=Model)` is silent.
tests/api_resources/beta/test_output_format_conversion.py:107
Function
test_stream_method_definition_in_sync
(sync: bool)
tests/lib/streaming/test_messages.py:669
Function
test_stream_method_definition_in_sync
(sync: bool)
tests/lib/streaming/test_beta_messages.py:927
Function
test_stream_permanent_4xx_ends_iteration
A permanent 4xx on the stream connect must not loop forever — the iterator should exit cleanly.
tests/lib/tools/test_session_runner.py:1557
Function
test_stream_raises_api_error_for_error_frame
( frame: bytes, error: t.Dict[str, str], sync: bool, respx_mock: MockRouter )
tests/lib/test_bedrock.py:448
Function
test_stream_rejects_a_schema_dict
(client: Anthropic)
tests/lib/test_output_format_helpers.py:69
Method
test_stream_rejects_schema_dict
A raw schema dict is no longer accepted by `.stream()`; it belongs in `output_config.format`.
tests/api_resources/beta/test_output_format_conversion.py:61
Function
test_stream_skips_typeless_chunk
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:393
Function
test_stream_skips_typeless_chunk_async
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:411
Method
test_stream_with_raw_schema
Test async messages.stream() with raw JSON schema via output_config.
tests/lib/_parse/test_messages.py:143
Method
test_stream_with_raw_schema
(self, async_snapshot_client: AsyncAnthropic)
tests/lib/_parse/test_beta_messages.py:20
← previous
next →
7,701–7,800 of 9,455, ranked by callers