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_empty_value_in_base_url_is_rejected
( self, name: str, deferred: bool, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_google_cloud.py:244
Method
test_empty_value_in_base_url_is_rejected
( self, name: str, deferred: bool, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_google_cloud.py:1433
Method
test_empty_value_in_organization_base_url_is_rejected
( self, name: str, project: str, location: str, respx_mock: MockRouter )
tests/lib/test_google_cloud.py:262
Method
test_empty_value_in_organization_base_url_is_rejected
( self, name: str, project: str, location: str, respx_mock: MockRouter )
tests/lib/test_google_cloud.py:1451
Method
test_empty_values_are_not_checked_with_explicit_base_url
(self, respx_mock: MockRouter)
tests/lib/test_google_cloud.py:274
Method
test_empty_values_are_not_checked_with_explicit_base_url
(self, respx_mock: MockRouter)
tests/lib/test_google_cloud.py:1463
Method
test_enabled_traces_have_spans
( self, traces: Any, sync: bool, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:3871
Function
test_enabling_an_unimplemented_member_is_a_configuration_error
()
tests/lib/tools/toolsets/test_pipeline.py:461
Function
test_enabling_file_upload_or_javascript_exec_requires_confirm
()
tests/lib/tools/toolsets/test_confirm.py:74
Function
test_enabling_javascript_exec_or_file_upload_requires_a_confirm_callable
()
tests/lib/tools/toolsets/test_pipeline.py:487
Function
test_endless_nesting_is_rejected
(send: Send, monkeypatch: pytest.MonkeyPatch)
tests/test_prepare.py:336
Method
test_entry_overrides_apply_to_the_hop_request
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1297
Method
test_entry_overrides_are_merged_whole_over_the_body
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:328
Function
test_enum_schema
()
tests/lib/_parse/test_transform.py:66
Function
test_env_api_key
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:306
Method
test_env_api_key_alone_does_not_warn
No shadow if there's nothing to shadow — env api_key alone (no auto-discoverable credential signals) is just the normal path.
tests/lib/test_credentials.py:4394
Method
test_env_api_key_and_auth_token_warn_once_per_process
( self, respx_mock: MockRouter, clean_env: pytest.MonkeyPatch, caplog: pytest.
tests/lib/test_credentials.py:4409
Method
test_env_api_key_returns_false
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:85
Method
test_env_api_key_shadows_env_federation_trio_with_warning
Env `ANTHROPIC_API_KEY` + env federation trio → api_key wins (step 2 beats step 4), warn so the user knows WIF is being shadowed.
tests/lib/test_credentials.py:4366
Method
test_env_api_key_shadows_env_profile_with_warning
( self, clean_env: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/test_credentials.py:4383
Function
test_env_base_url
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:320
Function
test_env_base_url_does_not_override_derived_url
(respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:1161
Function
test_env_base_url_does_not_override_derived_url_async
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:1179
Method
test_env_federation_beats_active_config_pointer
The profile that `active_config` points at is step 5, like `default`.
tests/lib/test_credentials.py:2287
Method
test_env_federation_beats_fallback_on_disk_profile
Step 4 (env federation trio) sits above step 5 (fallback on-disk profile) in the precedence spec: a machine with WIF env vars wired up
tests/lib/test_credentials.py:2269
Method
test_env_federation_beats_profile_in_config_dir_env
`ANTHROPIC_CONFIG_DIR` says where profiles are looked up. It selects none.
tests/lib/test_credentials.py:2314
Method
test_env_federation_does_not_read_broken_profile_in_config_dir_env
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:2328
Method
test_env_fills_missing_organization_id
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:1463
Method
test_env_fills_missing_workspace_id
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:1505
Method
test_env_overrides_active_config
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:1043
Function
test_env_region
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:314
Method
test_env_resolution
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:305
Method
test_env_takes_precedence_over_region
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:398
Method
test_env_var_base_url_override
Test that ANTHROPIC_VERTEX_BASE_URL environment variable does not override client arg.
tests/lib/test_vertex.py:375
Method
test_env_var_base_url_override
Test that ANTHROPIC_VERTEX_BASE_URL environment variable does not override client arg.
tests/lib/test_vertex.py:898
Method
test_env_var_fallback_chain
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:424
Method
test_env_var_fallback_chain_falls_through
Falls back to second env var when first is not set.
tests/lib/test_aws_auth.py:188
Method
test_env_var_fallback_chain_falls_through
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:268
Method
test_env_var_fallback_chain_falls_through
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:352
Method
test_env_var_fallback_chain_first_wins
First env var in the chain takes priority.
tests/lib/test_aws_auth.py:173
Method
test_env_var_fallback_chain_first_wins
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:256
Method
test_env_var_fallback_chain_first_wins
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:341
Method
test_env_var_fallback_chain_none_set
Defaults to SigV4 when no env vars in the chain are set.
tests/lib/test_aws_auth.py:203
Method
test_env_var_fallback_chain_none_set
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:363
Method
test_env_workspace_id_fills_user_oauth
`ANTHROPIC_WORKSPACE_ID` fills `workspace_id` uniformly across profile types — not just federation. This pins the precedence model: ct
tests/lib/test_credentials.py:1524
Method
test_environment_is_read_when_the_client_is_constructed
( self, sync: bool, registered: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:4720
Function
test_environment_key_threads_through_to_scoped_client
When an environment key is set, the runner asks `_scoped_client` for a Bearer-only sub-client keyed to that environment. The actual header shape
tests/lib/tools/test_session_runner.py:2034
Method
test_environment_order
With the sources before `first` unset and every later one set, `first` is sent.
tests/lib/test_credentials.py:4462
Method
test_environment_variable_disables_spans
(self, registered: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:2424
Method
test_environment_variable_enables_content
(self, registered: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:5611
Function
test_environment_worker_accepts_tools_factory
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:313
Function
test_environment_worker_ends_the_span_ok_when_the_item_is_stopped
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:1295
Function
test_environment_worker_fails_the_span_of_an_item_that_it_cannot_handle
( monkeypatch: pytest.MonkeyPatch, error: Exception, error_type: str )
tests/lib/environments/test_worker.py:1321
Function
test_environment_worker_falls_back_when_secret_undecodable
A secret payload that doesn't decode (or carries no sessions token) falls back to the environment key, with a warning that doesn't include the
tests/lib/environments/test_worker.py:384
Function
test_environment_worker_handles_an_item_in_its_span
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:1266
Function
test_environment_worker_leaves_the_span_unset_when_it_is_stopped
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:1384
Function
test_environment_worker_leaves_the_span_unset_when_it_loses_the_lease
( monkeypatch: pytest.MonkeyPatch, heartbeat_error: Exception )
tests/lib/environments/test_worker.py:1343
Function
test_environment_worker_leaves_the_span_unset_when_losing_the_lease_raises_an_error
( monkeypatch: pytest.MonkeyPatch, )
tests/lib/environments/test_worker.py:1358
Function
test_environment_worker_prefers_work_item_secret
A claimed item carrying a per-item `secret` payload authenticates that item's heartbeat / force-stop / session-runner calls with the sessions
tests/lib/environments/test_worker.py:340
Function
test_environment_worker_serves_session
(monkeypatch: pytest.MonkeyPatch)
tests/lib/environments/test_worker.py:242
Function
test_environment_worker_skips_non_session_item
The queue hands the worker a health check instead of a session. There is no session to look up or serve, but the item must still be stopped s
tests/lib/environments/test_worker.py:288
Function
test_environments_public_reexports
A user can type their own code against the public runner API without reaching into a `_`-private module.
tests/lib/tools/test_session_runner.py:2184
Function
test_error_raised_in_a_process_pool_reaches_the_caller
()
tests/test_exceptions.py:104
Method
test_error_response
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:976
Method
test_error_response_without_envelope
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:998
Function
test_error_type
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, )
tests/test_streaming.py:333
Method
test_error_with_retryable_cause_is_retried
( self, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_middleware.py:870
Method
test_eu_region_base_url
Test that us region uses the correct base URL.
tests/lib/test_vertex.py:363
Method
test_eu_region_base_url
Test that eu region uses the correct base URL.
tests/lib/test_vertex.py:884
Function
test_event_missing_data
(sync: bool, client: Anthropic, async_client: AsyncAnthropic)
tests/test_streaming.py:64
Function
test_event_start_for_a_non_agent_message_preview_returns_none
()
tests/lib/sessions/test_accumulate.py:64
Function
test_event_start_returns_a_fresh_empty_snapshot_from_none
()
tests/lib/sessions/test_accumulate.py:56
Method
test_event_stream_closed_early
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:2277
Method
test_event_stream_ended_by_the_server
(self, spans: Spans, respx_mock: MockRouter, raw: bool)
tests/test_open_telemetry.py:2295
Method
test_event_stream_has_the_ids_in_its_path
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:7614
Method
test_events_read_after_the_response_was_closed_leave_the_span_alone
( self, spans: Spans, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture )
tests/test_open_telemetry.py:1479
Method
test_every_attempt_has_the_qualifiers
( self, client: Anthropic, respx_mock: MockRouter, monkeypatch: pytest.MonkeyP
tests/test_client.py:1465
Method
test_every_attempt_has_the_qualifiers
( self, async_client: AsyncAnthropic, respx_mock: MockRouter, monkeypatch: pyt
tests/test_client.py:2916
Function
test_every_call_to_an_unregistered_family_in_a_turn_says_not_found
( client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, flavour: str )
tests/lib/tools/toolsets/test_runner.py:620
Function
test_every_confirmation_placeholder_has_a_template_field
()
tests/lib/tools/toolsets/test_computer_registry.py:87
Function
test_every_confirmation_placeholder_has_a_template_field
()
tests/lib/tools/toolsets/test_registry.py:115
Function
test_every_constructor_argument_is_covered
(client_class: ClientClass)
tests/lib/test_client_copy.py:241
Function
test_every_documented_name_is_exported
()
tests/lib/tools/toolsets/test_surface.py:47
Function
test_every_documented_name_is_exported
()
tests/lib/tools/toolsets/test_computer_surface.py:42
Function
test_every_member_is_enabled_by_default
()
tests/lib/tools/toolsets/test_computer_registry.py:40
Function
test_every_pure_action_has_confirmation_text_and_tab_members_render_state_only
()
tests/lib/tools/toolsets/test_registry.py:82
Method
test_every_request_names_the_thread_in_the_helper_telemetry_header
( self, respx_mock: MockRouter, method: str )
tests/lib/threads/test_beta_threads.py:229
Method
test_every_request_names_the_thread_in_the_helper_telemetry_header
( self, respx_mock: MockRouter, method: str )
tests/lib/threads/test_async_beta_threads.py:109
Function
test_every_state_change_kind_is_either_tab_opened_or_a_download_kind
A new change kind with a `url` in the generated union must be added to DOWNLOAD_TYPES, or the SDK neither bounds its `url` nor checks its `path` a
tests/lib/tools/toolsets/test_registry.py:123
Function
test_every_stop_reason_is_classified
()
tests/lib/tools/test_runners.py:774
Method
test_every_turn_and_a_thread_built_from_params_send_the_output_config_given_at_creation
( self, respx_mock: MockRouter, fields: dict[str, Any] )
tests/lib/threads/test_beta_threads.py:1467
Method
test_every_turn_drops_the_cache_markers_of_the_recorded_messages_once_unthreaded
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:983
Method
test_every_turn_sends_the_threads_beta_once_after_the_callers_betas
( self, respx_mock: MockRouter, betas: list[Any], expected: list[str] )
tests/lib/threads/test_beta_threads.py:182
Method
test_exchange
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1107
Method
test_exchange_federation_assertion_helper
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1202
Method
test_exchange_federation_assertion_http_rejected
(self)
tests/lib/test_credentials.py:1276
Function
test_execute_dispatches_to_the_member_method_and_refuses_unknown_names
()
tests/lib/tools/toolsets/test_interface.py:220
Function
test_execute_dispatches_to_the_member_method_and_refuses_unknown_names
()
tests/lib/tools/toolsets/test_computer_interface.py:136
Function
test_existing_text_index_appends
()
tests/lib/sessions/test_accumulate.py:78
Method
test_expired_but_nonzero_expiry_keeps_single_flight
Only exactly `expires_at=0` opts out of single-flight; any other past value is an expired token.
tests/lib/test_credentials.py:1811
← previous
next →
6,101–6,200 of 12,274, ranked by callers