Title: Use synthetic paths in test_dir.py to avoid Windows CI failures by Copilot · Pull Request #1909 · usethis-python/usethis-python · GitHub
Open Graph Title: Use synthetic paths in test_dir.py to avoid Windows CI failures by Copilot · Pull Request #1909 · usethis-python/usethis-python
X Title: Use synthetic paths in test_dir.py to avoid Windows CI failures by Copilot · Pull Request #1909 · usethis-python/usethis-python
Description: get_project_name_from_dir() only reads Path.name — it never touches the filesystem. Tests were unnecessarily creating real directories via tmp_path, which fails on Windows where "..." is interpreted as ../.. traversal and trailing dots are silently stripped. tests/usethis/_file/test_dir.py: Replace all tmp_path-based paths with string paths ("/fake/...") since no filesystem access is needed usethis-python-test skill (v1.5 → v1.6): Add guidance on preferring synthetic paths when testing pure path-metadata logic # Before: fails on Windows when dir_name is OS-special def test_leading_dots(self, tmp_path: Path): with usethis_config.set(project_dir=tmp_path / "..hidden"): assert get_project_name_from_dir() == "hidden" # After: no filesystem dependency def test_leading_dots(self): with usethis_config.set(project_dir="/fake/..hidden"): assert get_project_name_from_dir() == "hidden"
Open Graph Description: get_project_name_from_dir() only reads Path.name — it never touches the filesystem. Tests were unnecessarily creating real directories via tmp_path, which fails on Windows where "..." is ...
X Description: get_project_name_from_dir() only reads Path.name — it never touches the filesystem. Tests were unnecessarily creating real directories via tmp_path, which fails on Windows where "...&q...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1909
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:52a050b9-4529-8ade-a84f-c418cfc74542 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 80FE:10A1AD:152279:1EA07C:6A4E651B |
| html-safe-nonce | 46145d89dd1772fe837c6227db65973f89ac29021270d511748a45cc98384fcb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEZFOjEwQTFBRDoxNTIyNzk6MUVBMDdDOjZBNEU2NTFCIiwidmlzaXRvcl9pZCI6IjQwNzMzNTA1NDE1NDI4NDM2NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f38d740cc26764c4f49898db66fa16737a2494ce3003d7aa23a0c51ce12288d0 |
| hovercard-subject-tag | pull_request:3510670652 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1909/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | get_project_name_from_dir() only reads Path.name — it never touches the filesystem. Tests were unnecessarily creating real directories via tmp_path, which fails on Windows where "..." is ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width