Title: Only use `files_manager` in the test suite by Copilot · Pull Request #1827 · usethis-python/usethis-python · GitHub
Open Graph Title: Only use `files_manager` in the test suite by Copilot · Pull Request #1827 · usethis-python/usethis-python
X Title: Only use `files_manager` in the test suite by Copilot · Pull Request #1827 · usethis-python/usethis-python
Description: Tests inconsistently used individual file manager context managers (PyprojectTOMLManager, SetupCFGManager, etc.) instead of the unified files_manager(). This made tests fragile and inconsistent—files_manager() locks all managers atomically, which is the correct pattern. Test file changes (~270 replacements across 28 files) Simple cases: with change_cwd(tmp_path), PyprojectTOMLManager(): → with change_cwd(tmp_path), files_manager(): Multi-manager cases: collapsed PyprojectTOMLManager(), UVTOMLManager() into single files_manager() as binding cases: moved manager instantiation into the body since files_manager() already locks the class-level state: # Before with change_cwd(tmp_path), PyprojectTOMLManager() as mgr: mgr[["tool", "uv", "environments"]] = [] # After with change_cwd(tmp_path), files_manager(): mgr = PyprojectTOMLManager() mgr[["tool", "uv", "environments"]] = [] Updated imports: added files_manager, removed now-unused manager imports Enforcement hook Added a pygrep-language prek hook no-bare-managers-in-tests matching ^\s*with\b.*Manager\( in tests/, excluding the three base manager infrastructure test files (test_ini_io_.py, test_toml_io_.py, test_yaml_io_.py) that legitimately use custom My*Manager() subclasses.
Open Graph Description: Tests inconsistently used individual file manager context managers (PyprojectTOMLManager, SetupCFGManager, etc.) instead of the unified files_manager(). This made tests fragile and inconsistent—fil...
X Description: Tests inconsistently used individual file manager context managers (PyprojectTOMLManager, SetupCFGManager, etc.) instead of the unified files_manager(). This made tests fragile and inconsistent—fil...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1827
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:73ce8ca6-5087-a6c6-3f5f-6516fbd37f88 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 98CA:1E1ED:E29431:138485E:6A4DD212 |
| html-safe-nonce | bdbbeb5fc1213c48a848ddd52b8433af29d18d8d0107b0749e4f0722bec13102 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OENBOjFFMUVEOkUyOTQzMToxMzg0ODVFOjZBNEREMjEyIiwidmlzaXRvcl9pZCI6IjU5NjEzMTY2MTQ2NTc2NTk0MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dfdd24654514e64a6f7155299ab384994c898a794c07db2694a14ad7c3978ee4 |
| hovercard-subject-tag | pull_request:3494600530 |
| 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/1827/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 | Tests inconsistently used individual file manager context managers (PyprojectTOMLManager, SetupCFGManager, etc.) instead of the unified files_manager(). This made tests fragile and inconsistent—fil... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| 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 | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width