Skip to content

Commit

Permalink
Fix test case for toolchain find with no intepreters (#4408)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jun 19, 2024
1 parent 549d7df commit 2b74d13
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions crates/uv/tests/toolchain_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ fn toolchain_find() {
let context: TestContext = TestContext::new_with_versions(&["3.11", "3.12"]);

// No interpreters on the path
uv_snapshot!(context.filters(), context.toolchain_find(), @r###"
success: true
exit_code: 0
uv_snapshot!(context.filters(), context.toolchain_find().env("UV_TEST_PYTHON_PATH", ""), @r###"
success: false
exit_code: 2
----- stdout -----
[PYTHON-3.11]
----- 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
exit_code: 0
----- stdout -----
Expand All @@ -31,9 +30,7 @@ fn toolchain_find() {
"###);

// Request Python 3.12
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("3.12")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("3.12"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand All @@ -43,9 +40,7 @@ fn toolchain_find() {
"###);

// Request Python 3.11
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("3.11")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("3.11"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand All @@ -55,9 +50,7 @@ fn toolchain_find() {
"###);

// Request CPython
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("cpython")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("cpython"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand All @@ -67,9 +60,7 @@ fn toolchain_find() {
"###);

// Request CPython 3.12
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("cpython@3.12")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("cpython@3.12"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand All @@ -79,9 +70,7 @@ fn toolchain_find() {
"###);

// Request CPython 3.12 via partial key syntax
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("cpython-3.12")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("cpython-3.12"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand All @@ -106,9 +95,7 @@ fn toolchain_find() {
"###);

// Request PyPy
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("pypy")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("pypy"), @r###"
success: false
exit_code: 2
----- stdout -----
Expand All @@ -131,9 +118,7 @@ fn toolchain_find() {
"###);

// Request Python 3.11
uv_snapshot!(context.filters(), context.toolchain_find()
.arg("3.11")
, @r###"
uv_snapshot!(context.filters(), context.toolchain_find().arg("3.11"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand Down

0 comments on commit 2b74d13

Please sign in to comment.