fix: Separate Python version string and env name (#548)
This commit is contained in:
parent
e2e7277630
commit
27fad02837
|
@ -58,7 +58,7 @@ fn python_module(mut module: Module, pyenv_version_name: bool, python_version: S
|
|||
let formatted_version = format_python_version(&python_version);
|
||||
module.new_segment("version", &formatted_version);
|
||||
get_python_virtual_env()
|
||||
.map(|virtual_env| module.new_segment("virtualenv", &format!("({})", virtual_env)));
|
||||
.map(|virtual_env| module.new_segment("virtualenv", &format!(" ({})", virtual_env)));
|
||||
};
|
||||
|
||||
module
|
||||
|
|
|
@ -120,7 +120,7 @@ fn with_virtual_env() -> io::Result<()> {
|
|||
.output()?;
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
|
||||
let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.7.4(my_venv)"));
|
||||
let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.7.4 (my_venv)"));
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue