mirror of https://github.com/astral-sh/uv
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:
parent
aa52952512
commit
948071b2f2
|
|
@ -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
|
||||
"###);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue