Skip to main content

Crate uv_test

Crate uv_test 

Source

Modules§

find_links
A local HTTP server that serves a directory of files as a PEP 503 flat link page.
packse
Local mock index for packse scenario tests.

Macros§

capture_uv_snapshot
Capture a command’s output, optionally asserting it against a snapshot.
diff_uv_snapshot
Assert a snapshot of the diff between old and a command’s output.
get_bin
Return the path to the uv binary.
test_context
Create a new TestContext with the given Python version.
test_context_with_versions
Create a new TestContext with zero or more Python versions.
uv_snapshot
Run [assert_cmd_snapshot!], with default filters or with custom filters.

Structs§

ReadOnlyDirectoryGuard
A guard that sets a directory to read-only and restores original permissions when dropped.
TestContext
Create a context for tests which simplifies shared behavior across tests.

Enums§

WindowsFilters

Constants§

DEFAULT_PYTHON_VERSION
LATEST_PYTHON_3_12
READ_ONLY_GITHUB_SSH_DEPLOY_KEY
READ_ONLY_GITHUB_TOKEN
READ_ONLY_GITHUB_TOKEN_2

Functions§

apply_filters
Helper method to apply filters to a string. Useful when !uv_snapshot cannot be used.
copy_dir_ignore
Recursively copy a directory and its contents, skipping gitignored files.
decode_token
Decode a split, base64 encoded authentication token. We split and encode the token to bypass revoke by GitHub’s secret scanning
diff_snapshot
Creates a “unified” diff between the two line-oriented strings suitable for snapshotting.
download_to_disk
Simulates reqwest::blocking::get but returns bytes directly, and disables certificate verification, passing through the BaseClient
make_project
Create a stub package name in dir with the given pyproject.toml body.
python_path_with_versions
Create a PATH with the requested Python versions available in order.
run_and_format
Execute the command and format its output status, stdout and stderr into a snapshot string.
site_packages_path
venv_bin_path