mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: Enable the python module in virtual envs (#584)
This will enable the python module when a virtual environment has been activated, this is detected via the `VIRTUAL_ENV` env var.
This commit is contained in:
committed by
Matan Kushner
parent
fa1267f12f
commit
42f6868e3f
@@ -124,3 +124,20 @@ fn with_virtual_env() -> io::Result<()> {
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn with_active_venv() -> io::Result<()> {
|
||||
let dir = tempfile::tempdir()?;
|
||||
|
||||
let output = common::render_module("python")
|
||||
.env("VIRTUAL_ENV", "/foo/bar/my_venv")
|
||||
.arg("--path")
|
||||
.arg(dir.path())
|
||||
.output()?;
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
|
||||
let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.7.4 (my_venv)"));
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user