Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,522 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,522
◇
Types & classes
4,093
↳
Endpoints
47
Method
test_explicit_profile_beats_env_federation
Step 3 (ANTHROPIC_PROFILE) sits above step 4 (env federation). An explicit profile selection wins over a federation-configured environ
tests/lib/test_credentials.py:2360
Method
test_explicit_project_arg_beats_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:312
Method
test_exposes_configured_middleware
(self)
tests/test_middleware.py:1889
Method
test_external
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:275
Method
test_external_missing_credentials_file
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:300
Method
test_external_no_expiry
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:286
Method
test_external_rereads_credentials_on_each_call
An external process rotates the credentials file; config stays fixed.
tests/lib/test_credentials.py:290
Function
test_extra_body_anthropic_version_wins
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:372
Method
test_extra_body_anthropic_version_wins
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:211
Method
test_extra_body_anthropic_version_wins
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:730
Function
test_extra_body_anthropic_version_wins_async
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:390
Function
test_extra_body_is_merged_in
(send: Send)
tests/test_prepare.py:222
Method
test_extra_body_value_wins
(self, client: AnthropicBedrockMantle, respx_mock: MockRouter)
tests/lib/test_bedrock_mantle.py:741
Method
test_extra_headers_case_insensitive
(self, client: Anthropic)
tests/test_client.py:599
Method
test_extra_headers_case_insensitive
(self, async_client: AsyncAnthropic)
tests/test_client.py:2050
Method
test_extra_headers_omit_removes_default_header_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:131
Method
test_extra_headers_omit_removes_sdk_header_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:139
Method
test_extra_headers_replace_default_headers_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:71
Method
test_extra_headers_replace_generated_header_param_case_insensitively
(self)
tests/test_header_case_sensitivity.py:78
Method
test_extra_headers_replace_sdk_header_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:92
Method
test_extra_headers_value_is_sent_in_body
(self, client: AnthropicBedrockMantle, respx_mock: MockRouter)
tests/lib/test_bedrock_mantle.py:751
Function
test_extra_properties
()
tests/test_models.py:1054
Method
test_extra_query_iterator_survives_pagination
( self, respx_mock: MockRouter, client: Anthropic | AsyncAnthropic )
tests/test_prepare.py:835
Function
test_extra_query_omit_removes_default_query
(send: Send)
tests/test_prepare.py:520
Function
test_extract_drops_setuid_setgid_sticky
(make: ArchiveModeMaker, tmp_path: Path)
tests/lib/tools/test_skills.py:259
Method
test_extract_files_does_not_mutate_original_nested_array_path
(self)
tests/test_files.py:175
Method
test_extract_files_does_not_mutate_original_top_level
(self)
tests/test_files.py:164
Function
test_extract_flat_archive_unchanged
(make: ArchiveMaker, tmp_path: Path)
tests/lib/tools/test_skills.py:183
Function
test_extract_refuses_zip_slip
(tmp_path: Path)
tests/lib/tools/test_skills.py:192
Function
test_extract_response_type_binary_response
()
tests/test_response.py:51
Function
test_extract_response_type_concrete_subclasses
()
tests/test_response.py:45
Function
test_extract_response_type_direct_class_missing_type_arg
()
tests/test_response.py:37
Function
test_extract_response_type_direct_classes
()
tests/test_response.py:31
Function
test_extract_strips_skill_wrapper_dir
(make: ArchiveMaker, tmp_path: Path)
tests/lib/tools/test_skills.py:164
Function
test_extract_type_var
()
tests/test_utils/test_typing.py:27
Function
test_extract_type_var_generic_subclass
()
tests/test_utils/test_typing.py:38
Function
test_extract_type_var_generic_subclass_different_ordering_multiple
()
tests/test_utils/test_typing.py:67
Function
test_extract_type_var_generic_subclass_multiple
()
tests/test_utils/test_typing.py:58
Function
test_extract_type_var_multiple
()
tests/test_utils/test_typing.py:49
Method
test_failed_call_ends_the_loop_with_its_error
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:891
Function
test_failed_compaction_request_is_not_retried_and_frees_the_messages_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3191
Function
test_failed_compaction_request_is_not_retried_and_frees_the_messages_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3170
Method
test_failed_create_has_no_id
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:7458
Method
test_failed_replay_clears_previous_message_id
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:752
Method
test_failed_send_lets_the_next_send_run
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1574
Method
test_failed_send_lets_the_next_send_run
(self, respx_mock: MockRouter)
tests/lib/threads/test_async_beta_threads.py:385
Function
test_failed_skill_keeps_the_directory_it_would_have_replaced
( tmp_path: Path, async_client: AsyncAnthropic, respx_mock: MockRouter, failing_download: httpx2.Response
tests/lib/tools/test_skills.py:497
Method
test_failed_streamed_call_ends_the_loop_with_its_error
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:908
Method
test_failed_writeback_after_refresh_does_not_retain_tokens
A refresh that succeeds but fails to persist raises the write error (the refresh token may have rotated server-side) — but the propagating
tests/lib/test_credentials.py:5172
Method
test_fallback_credit_usage_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:638
Method
test_fallback_credit_usage_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:960
Method
test_fallback_on_overloaded_error
(self, respx_mock: MockRouter)
tests/test_middleware.py:710
Method
test_fallback_on_overloaded_error
(self, respx_mock: MockRouter)
tests/test_middleware.py:1467
Method
test_fallback_relabels_model
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:623
Method
test_fallback_relabels_model
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:944
Method
test_fallback_retry_sees_identical_request_state
(self, respx_mock: MockRouter)
tests/test_middleware.py:1137
Method
test_fallback_retry_sees_identical_request_state
(self, respx_mock: MockRouter)
tests/test_middleware.py:1660
Method
test_falls_back_to_aws_api_key_env_var
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:145
Method
test_false_keeps_a_span_that_the_sampler_dropped_current_for_the_requests
( self, sync: bool, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_open_telemetry.py:4199
Method
test_false_sends_no_trace_context_and_keeps_the_span
( self, provider: str, sync: bool, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPat
tests/test_open_telemetry.py:4170
Function
test_family_or_type_named_block_without_toolset_name_is_not_a_member_call
( client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, flavour: str )
tests/lib/tools/toolsets/test_runner.py:328
Function
test_field_named_cls
()
tests/test_models.py:967
Method
test_file_input_is_read_when_the_stream_is_entered
( self, respx_mock: MockRouter, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/streaming/test_messages.py:515
Method
test_file_input_is_read_when_the_stream_is_entered
( self, respx_mock: MockRouter, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/streaming/test_beta_messages.py:694
Method
test_file_input_markers
(self, respx_mock: MockRouter, client: Anthropic | AsyncAnthropic)
tests/test_prepare.py:793
Function
test_file_objects_must_read_as_bytes
(send: Send, monkeypatch: pytest.MonkeyPatch)
tests/test_prepare.py:661
Function
test_file_tools_confinement_matrix
The full path policy through the real tools: the workdir works, a memory folder mounted outside it works, a read-only memory folder reads but
tests/lib/tools/test_agent_toolset.py:1215
Method
test_file_upload_tag_is_appended_not_clobbered
(self, client: Anthropic, respx_mock: respx.MockRouter)
tests/lib/test_stainless_helpers.py:85
Method
test_file_upload_tag_is_appended_not_clobbered
( self, async_client: AsyncAnthropic, respx_mock: respx.MockRouter )
tests/lib/test_stainless_helpers.py:184
Method
test_file_upload_with_request_copying_middleware
(self, respx_mock: MockRouter, tmp_path: Path)
tests/test_middleware.py:1210
Method
test_file_value_is_same_reference
(self)
tests/test_files.py:121
Function
test_file_without_a_name_is_sent_unnamed
()
tests/test_files.py:88
Function
test_files_without_a_marker_are_neither_pushed_nor_pulled_over
Only the marker was deleted (a dotfile cleanup): the remaining files may hold un-pushed edits, so the pass must neither upload them, nor delete by
tests/lib/tools/memory_sync/test_folder_trust.py:149
Function
test_filestore_async_with_removes_root_only_if_created
(tmp_path: Path)
tests/lib/tools/test_file_store.py:333
Function
test_filestore_create_root_makes_the_folder_owner_only
(tmp_path: Path)
tests/lib/tools/test_file_store.py:507
Function
test_filestore_creates_every_parent_owner_only_under_permissive_umask
Every directory the store creates — including intermediate parents, which `mkdir(parents=True, mode=...)` would leave at the umask default — is 0o
tests/lib/tools/test_file_store.py:72
Function
test_filestore_dispose_removes_the_root_it_created_and_keeps_preexisting
(tmp_path: Path)
tests/lib/tools/test_file_store.py:347
Function
test_filestore_every_verb_refuses_an_escaping_path
`..` (and absolute) paths raise FileStoreError on every verb; nothing is read or written outside the root.
tests/lib/tools/test_file_store.py:88
Function
test_filestore_find_symlinks_reports_every_symlink
Listings skip symlinks silently; `find_symlinks` is how a caller sees them.
tests/lib/tools/test_file_store.py:177
Function
test_filestore_get_does_not_follow_a_symlink_leaf
A symlink at the target is refused on read and replaced — not written through — on put.
tests/lib/tools/test_file_store.py:117
Function
test_filestore_get_refuses_a_non_regular_file
A present-but-non-regular leaf (fifo, symlink, ...) raises FileStoreError instead of hanging or being read.
tests/lib/tools/test_file_store.py:132
Function
test_filestore_get_returns_none_when_absent
(store: FileStore)
tests/lib/tools/test_file_store.py:152
Function
test_filestore_hash_file_hashes_one_file_and_shares_the_cache
( store: FileStore, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_file_store.py:241
Function
test_filestore_hashtree_distrusts_fresh_stamps
Filesystems stamp times with coarse clocks, so a same-tick rewrite can reuse the exact stat identity of the version just hashed. A file whose
tests/lib/tools/test_file_store.py:461
Function
test_filestore_hashtree_hashes_regular_files_and_skips_symlinks
(tmp_path: Path, store: FileStore)
tests/lib/tools/test_file_store.py:196
Function
test_filestore_hashtree_refuses_a_symlinked_prefix
A prefix that is a symlink (here to a directory outside the root) is refused, not silently listed as empty.
tests/lib/tools/test_file_store.py:228
Function
test_filestore_hashtree_rehashes_only_what_changed
A file whose stat identity (mtime, ctime, size) is unchanged since the last walk is served from the cache; a changed file is re-read. The trust
tests/lib/tools/test_file_store.py:419
Function
test_filestore_is_path_legal
()
tests/lib/tools/test_file_store.py:411
Function
test_filestore_listings_raise_on_an_unreadable_subdirectory
An unreadable subdirectory fails the listing rather than dropping out of it.
tests/lib/tools/test_file_store.py:209
Function
test_filestore_ls_lists_recursively_and_never_descends_symlinks
(tmp_path: Path, store: FileStore)
tests/lib/tools/test_file_store.py:159
Function
test_filestore_move_never_creates_a_missing_root
(store: FileStore)
tests/lib/tools/test_file_store.py:549
Function
test_filestore_move_renames_within_root_and_refuses_existing_dest
(store: FileStore)
tests/lib/tools/test_file_store.py:269
Function
test_filestore_open_raises_on_an_unreadable_mount_path
A mount path the process cannot stat raises at open — it is never read as absent, which would mark a real directory ours to remove on dispose.
tests/lib/tools/test_file_store.py:319
Function
test_filestore_put_executable_sets_owner_exec
(store: FileStore)
tests/lib/tools/test_file_store.py:58
Function
test_filestore_put_is_atomic_and_leaves_no_temp_on_success
(store: FileStore)
tests/lib/tools/test_file_store.py:64
Function
test_filestore_put_never_creates_a_missing_root
Only create_root() makes the folder: a put into a store that was never created, or whose folder was removed, raises and re-creates nothing — not
tests/lib/tools/test_file_store.py:516
Function
test_filestore_put_refuses_a_directory_rel
(store: FileStore, bad: str)
tests/lib/tools/test_file_store.py:376
Function
test_filestore_put_writes_archive_bytes_verbatim
Archive-shaped bytes land as a single byte-identical file — extraction is never inferred from the content.
tests/lib/tools/test_file_store.py:361
Function
test_filestore_put_writes_text_and_creates_owner_only_parents
`put` creates nested parents 0o700 and stores text as UTF-8 (file 0o600).
tests/lib/tools/test_file_store.py:47
Function
test_filestore_remove_deletes_file_and_subtree
(store: FileStore)
tests/lib/tools/test_file_store.py:298
← previous
next →
6,301–6,400 of 12,522, ranked by callers