Skip to main content

Crate uv_test

Crate uv_test 

Source

Macros§

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_10
LATEST_PYTHON_3_11
LATEST_PYTHON_3_12
LATEST_PYTHON_3_13
LATEST_PYTHON_3_14
LATEST_PYTHON_3_15
PACKSE_VERSION
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.
build_vendor_links_url
Using a find links url allows using --index-url instead of --extra-index-url in tests to prevent dependency confusion attacks against our test suite.
copy_dir_ignore
Recursively copy a directory and its contents, skipping gitignored files.
create_venv_from_executable
Create a virtual environment at the given path.
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
get_python
Get the path to the python interpreter for a specific python version.
make_project
Create a stub package name in dir with the given pyproject.toml body.
packse_index_url
python_installations_for_versions
Returns a list of Python executables for the given versions.
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.
run_and_format_with_status
Execute the command and format its output status, stdout and stderr into a snapshot string.
site_packages_path
venv_bin_path