Skip to content

Commit a3ebef2

Browse files
CopilotDonJayamanne
andcommitted
Add documentation to path identification test file
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
1 parent 8f1f5c0 commit a3ebef2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

crates/pet-poetry/tests/path_identification_test.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
use std::path::PathBuf;
4+
//! Tests for Poetry environment identification by path pattern.
5+
//!
6+
//! This test module verifies that Poetry environments are correctly identified
7+
//! even when they are not discovered during the find() phase. This can happen when:
8+
//! - Workspace directories are not configured
9+
//! - The pyproject.toml is not in the workspace directories
10+
//! - The environment is in the Poetry cache but wasn't enumerated
11+
//!
12+
//! The fix adds a fallback path-based detection that checks if the environment
13+
//! path matches Poetry's naming pattern ({name}-{8-char-hash}-py{version}) and
14+
//! is located in a Poetry cache directory (containing "pypoetry/virtualenvs").
515
6-
// Import the is_poetry_environment function - we'll need to make it public for testing
7-
// For now, we'll test via the public API
16+
use std::path::PathBuf;
817

918
#[cfg(test)]
1019
mod tests {

0 commit comments

Comments
 (0)