Commit 0c0e9e8
committed
Fix Windows path compatibility using tmp_path fixture
The previous fix still failed on Windows because Path() objects created
from Unix-style paths (/tmp/file) are not equal to Path objects created
from Windows-style paths (D:\tmp\file), even when comparing Path objects.
Solution: Use pytest's tmp_path fixture to create platform-appropriate
absolute paths for testing. This ensures the test works correctly on all
platforms (Windows, Linux, macOS) by using real absolute paths from the
filesystem.
The test now verifies:
1. The path returned equals the path provided (using actual absolute paths)
2. The path is absolute (using path.is_absolute())
This approach is more robust and platform-agnostic.1 parent 59b52df commit 0c0e9e8
2 files changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
231 | 232 | | |
232 | | - | |
| 233 | + | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
0 commit comments