mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
more managed
This commit is contained in:
parent
7e5d135df6
commit
92637c0d0a
2 changed files with 37 additions and 29 deletions
|
@ -3,8 +3,9 @@ use std::{env, path::Path, process::Command};
|
||||||
use crate::common::{TestContext, uv_snapshot};
|
use crate::common::{TestContext, uv_snapshot};
|
||||||
use assert_fs::{
|
use assert_fs::{
|
||||||
assert::PathAssert,
|
assert::PathAssert,
|
||||||
prelude::{FileTouch, PathChild, PathCreateDir},
|
prelude::{FileTouch, FileWriteStr, PathChild, PathCreateDir},
|
||||||
};
|
};
|
||||||
|
use indoc::indoc;
|
||||||
use predicates::prelude::predicate;
|
use predicates::prelude::predicate;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
use uv_fs::Simplified;
|
use uv_fs::Simplified;
|
||||||
|
@ -286,6 +287,41 @@ fn python_install_automatic() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Regression test for a bad cpython runtime
|
||||||
|
/// <https://github.com/astral-sh/uv/issues/13610>
|
||||||
|
#[test]
|
||||||
|
fn regression_cpython() {
|
||||||
|
let context: TestContext = TestContext::new_with_versions(&[])
|
||||||
|
.with_filtered_python_keys()
|
||||||
|
.with_filtered_exe_suffix()
|
||||||
|
.with_filtered_python_sources()
|
||||||
|
.with_managed_python_dirs();
|
||||||
|
|
||||||
|
let init = context.temp_dir.child("mre.py");
|
||||||
|
init.write_str(indoc! { r#"
|
||||||
|
class Foo(str): ...
|
||||||
|
|
||||||
|
a = []
|
||||||
|
new_value = Foo("1")
|
||||||
|
a += new_value
|
||||||
|
"#
|
||||||
|
})
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
// We should respect the Python request
|
||||||
|
uv_snapshot!(context.filters(), context.run()
|
||||||
|
.env_remove("VIRTUAL_ENV")
|
||||||
|
.arg("-p").arg("3.12")
|
||||||
|
.arg("mre.py"), @r###"
|
||||||
|
success: true
|
||||||
|
exit_code: 0
|
||||||
|
----- stdout -----
|
||||||
|
|
||||||
|
----- stderr -----
|
||||||
|
|
||||||
|
"###);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn python_install_preview() {
|
fn python_install_preview() {
|
||||||
let context: TestContext = TestContext::new_with_versions(&[])
|
let context: TestContext = TestContext::new_with_versions(&[])
|
||||||
|
|
|
@ -3389,34 +3389,6 @@ fn run_script_module_conflict() -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Regression test for a bad cpython runtime
|
|
||||||
/// <https://github.com/astral-sh/uv/issues/13610>
|
|
||||||
#[test]
|
|
||||||
fn regression_cpython_runtime() -> Result<()> {
|
|
||||||
let context = TestContext::new("3.12");
|
|
||||||
|
|
||||||
let init = context.temp_dir.child("mre.py");
|
|
||||||
init.write_str(indoc! { r#"
|
|
||||||
class Foo(str): ...
|
|
||||||
|
|
||||||
a = []
|
|
||||||
new_value = Foo("1")
|
|
||||||
a += new_value
|
|
||||||
"#
|
|
||||||
})?;
|
|
||||||
|
|
||||||
uv_snapshot!(context.filters(), context.run()
|
|
||||||
.arg("-p").arg("3.12")
|
|
||||||
.arg("mre.py"), @r"
|
|
||||||
success: true
|
|
||||||
exit_code: 0
|
|
||||||
----- stdout -----
|
|
||||||
|
|
||||||
----- stderr -----
|
|
||||||
");
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn run_script_explicit() -> Result<()> {
|
fn run_script_explicit() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue