Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with custom install dir #10048

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Testing uv requires multiple specific Python versions; they can be installed wit
cargo run python install
```

The storage directory can be configured with `UV_PYTHON_INSTALL_DIR`.
The storage directory can be configured with `UV_PYTHON_INSTALL_DIR`. (It must be an absolute path.)

### Snapshot testing

Expand Down
6 changes: 6 additions & 0 deletions crates/uv/tests/it/help.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::env;

use crate::common::{uv_snapshot, TestContext};

#[test]
Expand Down Expand Up @@ -450,6 +452,10 @@ fn help_subcommand() {

#[test]
fn help_subsubcommand() {
if env::var("UV_PYTHON_INSTALL_DIR").is_ok() {
// skip this test
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, you can use instead

uv_snapshot!(context.filters(), context.help().env_remove(EnvVars::UV_PYTHON_INSTALL_DIR).arg("python").arg("install"), @r###"

let context = TestContext::new_with_versions(&[]);

uv_snapshot!(context.filters(), context.help().arg("python").arg("install"), @r###"
Expand Down
Loading