diff --git a/crates/puffin/tests/pip_sync.rs b/crates/puffin/tests/pip_sync.rs index 3f2684a672d5..b84ebfc1667e 100644 --- a/crates/puffin/tests/pip_sync.rs +++ b/crates/puffin/tests/pip_sync.rs @@ -1,8 +1,8 @@ #![cfg(all(feature = "python", feature = "pypi"))] -use std::iter; use std::path::Path; use std::process::Command; +use std::{fs, iter}; use anyhow::{Context, Result}; use assert_cmd::prelude::*; @@ -121,6 +121,11 @@ fn install() -> Result<()> { check_command(&venv, "import markupsafe", &temp_dir); + // Removing the cache shouldn't invalidate the virtual environment. + fs::remove_dir_all(cache_dir.path())?; + + check_command(&venv, "import markupsafe", &temp_dir); + Ok(()) } @@ -163,6 +168,11 @@ fn install_copy() -> Result<()> { check_command(&venv, "import markupsafe", &temp_dir); + // Removing the cache shouldn't invalidate the virtual environment. + fs::remove_dir_all(cache_dir.path())?; + + check_command(&venv, "import markupsafe", &temp_dir); + Ok(()) } @@ -205,6 +215,11 @@ fn install_hardlink() -> Result<()> { check_command(&venv, "import markupsafe", &temp_dir); + // Removing the cache shouldn't invalidate the virtual environment. + fs::remove_dir_all(cache_dir.path())?; + + check_command(&venv, "import markupsafe", &temp_dir); + Ok(()) }