mirror of https://github.com/astral-sh/uv
Fix test case for `toolchain find` with no intepreters (#4408)
This commit is contained in:
parent
549d7dfe37
commit
2b74d13f40
|
|
@ -10,6 +10,16 @@ fn toolchain_find() {
|
||||||
let context: TestContext = TestContext::new_with_versions(&["3.11", "3.12"]);
|
let context: TestContext = TestContext::new_with_versions(&["3.11", "3.12"]);
|
||||||
|
|
||||||
// No interpreters on the path
|
// No interpreters on the path
|
||||||
|
uv_snapshot!(context.filters(), context.toolchain_find().env("UV_TEST_PYTHON_PATH", ""), @r###"
|
||||||
|
success: false
|
||||||
|
exit_code: 2
|
||||||
|
----- stdout -----
|
||||||
|
|
||||||
|
----- stderr -----
|
||||||
|
error: No Python interpreters found in provided path, active virtual environment, or search path
|
||||||
|
"###);
|
||||||
|
|
||||||
|
// We find the first interpreter on the path
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find(), @r###"
|
uv_snapshot!(context.filters(), context.toolchain_find(), @r###"
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
|
|
@ -19,21 +29,8 @@ fn toolchain_find() {
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// We find the first interpreter on the path
|
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
|
||||||
, @r###"
|
|
||||||
success: true
|
|
||||||
exit_code: 0
|
|
||||||
----- stdout -----
|
|
||||||
[PYTHON-3.11]
|
|
||||||
|
|
||||||
----- stderr -----
|
|
||||||
"###);
|
|
||||||
|
|
||||||
// Request Python 3.12
|
// Request Python 3.12
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("3.12"), @r###"
|
||||||
.arg("3.12")
|
|
||||||
, @r###"
|
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -43,9 +40,7 @@ fn toolchain_find() {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Request Python 3.11
|
// Request Python 3.11
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("3.11"), @r###"
|
||||||
.arg("3.11")
|
|
||||||
, @r###"
|
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -55,9 +50,7 @@ fn toolchain_find() {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Request CPython
|
// Request CPython
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("cpython"), @r###"
|
||||||
.arg("cpython")
|
|
||||||
, @r###"
|
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -67,9 +60,7 @@ fn toolchain_find() {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Request CPython 3.12
|
// Request CPython 3.12
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("cpython@3.12"), @r###"
|
||||||
.arg("cpython@3.12")
|
|
||||||
, @r###"
|
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -79,9 +70,7 @@ fn toolchain_find() {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Request CPython 3.12 via partial key syntax
|
// Request CPython 3.12 via partial key syntax
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("cpython-3.12"), @r###"
|
||||||
.arg("cpython-3.12")
|
|
||||||
, @r###"
|
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -106,9 +95,7 @@ fn toolchain_find() {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Request PyPy
|
// Request PyPy
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("pypy"), @r###"
|
||||||
.arg("pypy")
|
|
||||||
, @r###"
|
|
||||||
success: false
|
success: false
|
||||||
exit_code: 2
|
exit_code: 2
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -131,9 +118,7 @@ fn toolchain_find() {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Request Python 3.11
|
// Request Python 3.11
|
||||||
uv_snapshot!(context.filters(), context.toolchain_find()
|
uv_snapshot!(context.filters(), context.toolchain_find().arg("3.11"), @r###"
|
||||||
.arg("3.11")
|
|
||||||
, @r###"
|
|
||||||
success: true
|
success: true
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue