Skip to content

Commit e23da5b

Browse files
authored
Use EnvVars for Conda variables in tests (#15930)
1 parent f122387 commit e23da5b

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

crates/uv-python/src/lib.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,8 @@ mod tests {
12081208
// But not if it's a base environment
12091209
let result = context.run_with_vars(
12101210
&[
1211-
("CONDA_PREFIX", Some(baseenv.as_os_str())),
1212-
("CONDA_DEFAULT_ENV", Some(&OsString::from("base"))),
1211+
(EnvVars::CONDA_PREFIX, Some(baseenv.as_os_str())),
1212+
(EnvVars::CONDA_DEFAULT_ENV, Some(&OsString::from("base"))),
12131213
(EnvVars::CONDA_ROOT, None),
12141214
],
12151215
|| {
@@ -1232,8 +1232,8 @@ mod tests {
12321232
let python = context
12331233
.run_with_vars(
12341234
&[
1235-
("CONDA_PREFIX", Some(baseenv.as_os_str())),
1236-
("CONDA_DEFAULT_ENV", Some(&OsString::from("base"))),
1235+
(EnvVars::CONDA_PREFIX, Some(baseenv.as_os_str())),
1236+
(EnvVars::CONDA_DEFAULT_ENV, Some(&OsString::from("base"))),
12371237
(EnvVars::CONDA_ROOT, None),
12381238
],
12391239
|| {
@@ -1258,8 +1258,11 @@ mod tests {
12581258
let python = context
12591259
.run_with_vars(
12601260
&[
1261-
("CONDA_PREFIX", Some(condaenv.as_os_str())),
1262-
("CONDA_DEFAULT_ENV", Some(&OsString::from("condaenv"))),
1261+
(EnvVars::CONDA_PREFIX, Some(condaenv.as_os_str())),
1262+
(
1263+
EnvVars::CONDA_DEFAULT_ENV,
1264+
Some(&OsString::from("condaenv")),
1265+
),
12631266
],
12641267
|| {
12651268
find_python_installation(
@@ -1282,8 +1285,8 @@ mod tests {
12821285
// When CONDA_DEFAULT_ENV is "base", it should always be treated as base environment
12831286
let result = context.run_with_vars(
12841287
&[
1285-
("CONDA_PREFIX", Some(condaenv.as_os_str())),
1286-
("CONDA_DEFAULT_ENV", Some(&OsString::from("base"))),
1288+
(EnvVars::CONDA_PREFIX, Some(condaenv.as_os_str())),
1289+
(EnvVars::CONDA_DEFAULT_ENV, Some(&OsString::from("base"))),
12871290
],
12881291
|| {
12891292
find_python_installation(
@@ -1307,8 +1310,8 @@ mod tests {
13071310
let python = context
13081311
.run_with_vars(
13091312
&[
1310-
("CONDA_PREFIX", Some(myenv_dir.as_os_str())),
1311-
("CONDA_DEFAULT_ENV", Some(&OsString::from("myenv"))),
1313+
(EnvVars::CONDA_PREFIX, Some(myenv_dir.as_os_str())),
1314+
(EnvVars::CONDA_DEFAULT_ENV, Some(&OsString::from("myenv"))),
13121315
],
13131316
|| {
13141317
find_python_installation(

0 commit comments

Comments
 (0)