mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-16 01:35:00 +00:00
Add test case for Python selection when invoked with python -m uv --system
(#7439)
This commit is contained in:
parent
6066989ed4
commit
d3e6765cea
1 changed files with 21 additions and 0 deletions
|
@ -1230,6 +1230,27 @@ mod tests {
|
|||
"We should prefer the parent interpreter"
|
||||
);
|
||||
|
||||
// Test with `EnvironmentPreference::OnlySystem`
|
||||
let python = context.run_with_vars(
|
||||
&[
|
||||
("UV_INTERNAL__PARENT_INTERPRETER", Some(parent.as_os_str())),
|
||||
("VIRTUAL_ENV", Some(venv.as_os_str())),
|
||||
],
|
||||
|| {
|
||||
find_python_installation(
|
||||
&PythonRequest::Any,
|
||||
EnvironmentPreference::OnlySystem,
|
||||
PythonPreference::OnlySystem,
|
||||
&context.cache,
|
||||
)
|
||||
},
|
||||
)??;
|
||||
assert_eq!(
|
||||
python.interpreter().python_full_version().to_string(),
|
||||
"3.12.3",
|
||||
"We should prefer the system interpreter"
|
||||
);
|
||||
|
||||
// Test with `EnvironmentPreference::OnlyVirtual`
|
||||
let python = context.run_with_vars(
|
||||
&[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue