Add test cases for finding unsupported versions (#7265)

Loosely testing for regressions in
https://github.com/astral-sh/uv/pull/7265
This commit is contained in:
Zanie Blue 2024-09-10 13:49:30 -05:00 committed by GitHub
parent aa52952512
commit 948071b2f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 36 additions and 0 deletions

View File

@ -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
"###);
}