Skip to content

Commit

Permalink
Add test cases for finding unsupported versions (#7265)
Browse files Browse the repository at this point in the history
Loosely testing for regressions in
#7265
  • Loading branch information
zanieb committed Sep 10, 2024
1 parent aa52952 commit 948071b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions crates/uv/tests/python_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,39 @@ fn python_find_venv() {
----- stderr -----
"###);
}

#[cfg(unix)]
#[test]
fn python_find_unsupported_version() {
let context: TestContext = TestContext::new_with_versions(&["3.12"]);

// Request a low version
uv_snapshot!(context.filters(), context.python_find().arg("3.6"), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: No interpreter found for Python 3.6 in virtual environments or system path
"###);

// Request a really low version
uv_snapshot!(context.filters(), context.python_find().arg("2.6"), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: No interpreter found for Python 2.6 in virtual environments or system path
"###);

// Request a future version
uv_snapshot!(context.filters(), context.python_find().arg("4.2"), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: No interpreter found for Python 4.2 in virtual environments or system path
"###);
}

0 comments on commit 948071b

Please sign in to comment.