Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,824 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,824
◇
Types & classes
4,274
↳
Endpoints
47
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:487
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:5221
Method
test_invalid_http_client
(self)
tests/test_client.py:527
Method
test_invalid_http_client
(self)
tests/test_client.py:1976
Method
test_invalid_json_credentials_does_not_retain_raw_text
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:5422
Method
test_invalid_profile_name_raises_anthropic_error
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4349
Method
test_invalidate
(self)
tests/lib/test_credentials.py:1723
Method
test_invalidate_forces_provider_refresh
After invalidate(), the next provider call receives force_refresh=True so providers with on-disk caches bypass their freshness short-c
tests/lib/test_credentials.py:1916
Method
test_is_content_query
(self, query: str, content_names: tuple[str, ...], content: bool)
tests/test_open_telemetry.py:3369
Function
test_is_fatal_status_error
(status: int, fatal: bool)
tests/lib/environments/test_poller.py:44
Function
test_is_fatal_status_error_ignores_non_api_errors
()
tests/lib/environments/test_poller.py:48
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback.py:844
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback.py:941
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback_streaming.py:1650
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback_streaming.py:1901
Function
test_isinstance_check
(client: Anthropic, async_client: AsyncAnthropic)
tests/test_streaming.py:351
Function
test_isinstance_does_not_error
()
tests/test_utils/test_proxy.py:26
Function
test_iso8601_datetime
()
tests/test_models.py:457
Function
test_iter_work_auto_stop_false_does_not_stop_on_body_raise
()
tests/lib/environments/test_poller_method.py:304
Function
test_iter_work_auto_stop_false_never_stops
A dispatcher hands work off to another process that owns the stop call. The poller must not stop the lease out from under that process.
tests/lib/environments/test_poller_method.py:290
Function
test_iter_work_backs_off_on_httpx_transport_error
A raw `httpx` transport error (not wrapped in an SDK `APIError`) is still transient and must be retried, not propagated.
tests/lib/environments/test_poller_method.py:216
Function
test_iter_work_backs_off_on_transient_error
(status: int)
tests/lib/environments/test_poller_method.py:181
Function
test_iter_work_block_ms_none_omits_param
The server rejects block_ms=0; None must translate to the omit sentinel so the poll is non-blocking instead of 400ing.
tests/lib/environments/test_poller_method.py:323
Function
test_iter_work_calls_stop_when_body_raises
()
tests/lib/environments/test_poller_method.py:167
Function
test_iter_work_drain_returns_immediately_when_queue_empty
()
tests/lib/environments/test_poller_method.py:282
Function
test_iter_work_drain_returns_on_empty_queue
()
tests/lib/environments/test_poller_method.py:271
Function
test_iter_work_force_stops_on_permanent_ack_failure
A permanent 4xx on ack force-stops the item rather than re-delivering it.
tests/lib/environments/test_poller_method.py:255
Function
test_iter_work_forwards_reclaim_older_than_ms
()
tests/lib/environments/test_poller_method.py:315
Function
test_iter_work_logs_idle_polling
(monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture)
tests/lib/environments/test_poller_method.py:385
Function
test_iter_work_propagates_non_api_error_from_ack
Same for a non-API error raised by `ack` — it propagates rather than backing off and retrying.
tests/lib/environments/test_poller_method.py:239
Function
test_iter_work_propagates_non_api_error_instead_of_retrying
A programming error (here `KeyError`) is not a transient API/transport failure, so it must propagate immediately rather than be swallowed and
tests/lib/environments/test_poller_method.py:227
Function
test_iter_work_raises_on_permanent_4xx
()
tests/lib/environments/test_poller_method.py:190
Function
test_iter_work_stop_conflict_is_silent
A 409 from `stop` means the work already ended; it is neither logged nor allowed to break the loop.
tests/lib/environments/test_poller_method.py:198
Function
test_iter_work_threads_extra_headers_into_force_stop
A permanent ack failure force-stops the item; the passthrough header must ride along on that force-stop call too.
tests/lib/environments/test_poller_method.py:519
Function
test_iter_work_threads_extra_headers_into_poll_ack_stop
()
tests/lib/environments/test_poller_method.py:505
Function
test_iter_work_yields_acks_and_stops_one_item
()
tests/lib/environments/test_poller_method.py:151
Function
test_iterable_construction
(data: Iterable[int], expected_validated: Iterable[int])
tests/test_models.py:1100
Function
test_iterable_construction_str_falls_back_to_list
()
tests/test_models.py:1116
Method
test_iterables_and_mappings
(self)
tests/test_utils/test_json.py:38
Function
test_jitter_within_bounds
()
tests/lib/environments/test_poller.py:23
Method
test_json_string_echo_response_does_not_retain_assertion
A 200 whose body is a JSON *string* echoing the assertion must be rejected at the wrap boundary — never bound to a frame local on its
tests/lib/test_credentials.py:5252
Function
test_keeps_const_and_enum_and_drops_type
(schema: dict[str, Any], expected: dict[str, Any])
tests/lib/_parse/test_transform.py:89
Function
test_keeps_none
(send: Send)
tests/test_prepare.py:232
Function
test_keeps_pydantic_literals
()
tests/lib/_parse/test_transform.py:120
Function
test_keeps_the_host_and_headers_of_the_parents_credential
`copy()` drops both with the credential that brought them, but the bearer is for the deployment and workspace the parent talks to.
tests/lib/test_scoped_client.py:168
Function
test_keyword_only_param
()
tests/test_required_args.py:30
Method
test_late_401_for_replaced_token_does_not_refresh_again
A 401 for a token the cache already replaced is retried with the newer token.
tests/lib/test_credentials.py:2883
Method
test_late_401_forces_refresh_for_per_request_tokens
A per-request token (`expires_at=0`) differs on every call, so a late 401 still forces a refresh.
tests/lib/test_credentials.py:2908
Method
test_late_per_request_result_does_not_replace_cached_expiring_token
(self)
tests/lib/test_credentials.py:2076
Method
test_later_request_options_replace_the_threads_as_a_whole
(self, respx_mock: MockRouter)
tests/lib/threads/test_async_beta_threads.py:136
Method
test_later_thread_events_do_not_replace_the_primary_thread
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:2429
Method
test_later_turns_run_in_the_container_of_the_last_reply
( self, respx_mock: MockRouter, fields: dict[str, Any], expected: Any )
tests/lib/threads/test_beta_threads.py:1177
Function
test_leading_semicolon_rejected
(template: str, kwargs: dict[str, Any])
tests/test_utils/test_path.py:109
Function
test_lease_assumed_lost_releases_item_without_stopping_it
Transient heartbeat failures lasting past the lease TTL mean another worker may hold the item by now, so it is released without a force-stop.
tests/lib/environments/test_worker.py:557
Function
test_lease_lost_classification
Only the two reasons where the item now belongs to someone else read as lost; every other reason, and no recorded reason at all, keeps the for
tests/lib/environments/test_worker.py:588
Method
test_leaves_accepted_requests_and_the_response_untouched
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:232
Function
test_lets_the_caller_refuse_a_held_call_by_removing_its_tool
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:537
Method
test_lib_client_construction_validates_middleware
(self)
tests/test_middleware.py:2154
Method
test_lib_clients_copy_inherits_replaces_and_clears
(self)
tests/test_middleware.py:2114
Method
test_list_comprehension
(self)
tests/lib/tools/test_mcp_tool.py:198
Method
test_list_comprehension
(self)
tests/lib/tools/test_mcp_tool.py:317
Method
test_list_has_only_the_ids_in_its_path
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:7590
Function
test_list_in_a_query
(client_class: ClientClass)
tests/lib/test_client_copy.py:349
Function
test_list_mismatched_type
()
tests/test_models.py:130
Function
test_list_nested_model
()
tests/test_models.py:69
Function
test_list_of_unions
()
tests/test_models.py:320
Function
test_list_optional_items_nested_model
()
tests/test_models.py:110
← previous
next →
6,701–6,800 of 12,824, ranked by callers