diff --git a/crates/socket-patch-cli/tests/in_process_scan.rs b/crates/socket-patch-cli/tests/in_process_scan.rs index 4e83ffba4..5afca9e02 100644 --- a/crates/socket-patch-cli/tests/in_process_scan.rs +++ b/crates/socket-patch-cli/tests/in_process_scan.rs @@ -1457,9 +1457,14 @@ async fn scan_ignores_ambient_virtual_env() { mock_batch_empty(&server).await; let decoy = tempfile::tempdir().unwrap(); - let dist_info = decoy - .path() - .join("lib/python3.11/site-packages/decoy_pkg-9.9.9.dist-info"); + // The venv layout the Python crawler reads on this platform (Windows + // has no per-version directory), so the decoy is one it would find. + let site_packages = if cfg!(windows) { + decoy.path().join("Lib").join("site-packages") + } else { + decoy.path().join("lib/python3.11/site-packages") + }; + let dist_info = site_packages.join("decoy_pkg-9.9.9.dist-info"); std::fs::create_dir_all(&dist_info).unwrap(); std::fs::write( dist_info.join("METADATA"), diff --git a/crates/socket-patch-cli/tests/scan/scan_project_discovery_e2e.rs b/crates/socket-patch-cli/tests/scan/scan_project_discovery_e2e.rs index 064c6fa10..6a1277a7e 100644 --- a/crates/socket-patch-cli/tests/scan/scan_project_discovery_e2e.rs +++ b/crates/socket-patch-cli/tests/scan/scan_project_discovery_e2e.rs @@ -478,7 +478,14 @@ async fn agent_scan_names_a_python_project_below_with_its_own_venv() { std::fs::create_dir_all(root.join(".git")).unwrap(); std::fs::write(root.join(".gitignore"), ".venv/\n").unwrap(); let svc = root.join("svc"); - let dist = svc.join(".venv/lib/python3.12/site-packages/six-1.16.0.dist-info"); + // The venv layout the Python crawler reads on this platform: Windows + // has no per-version directory. + let site_packages = if cfg!(windows) { + svc.join(".venv").join("Lib").join("site-packages") + } else { + svc.join(".venv/lib/python3.12/site-packages") + }; + let dist = site_packages.join("six-1.16.0.dist-info"); std::fs::create_dir_all(&dist).unwrap(); std::fs::write(svc.join(".venv/pyvenv.cfg"), "version = 3.12.0\n").unwrap(); std::fs::write(