Title: Tests for `pathlib.Path.walk()` are a little fragile · Issue #103517 · python/cpython · GitHub
Open Graph Title: Tests for `pathlib.Path.walk()` are a little fragile · Issue #103517 · python/cpython
X Title: Tests for `pathlib.Path.walk()` are a little fragile · Issue #103517 · python/cpython
Description: test_walk_topdown() attempts to handle all possible visitation orders, but the result is difficult to read. We can enforce a specific order by sorting dirnames. cpython/Lib/test/test_pathlib.py Lines 2680 to 2694 in a6f9594 def test_walk...
Open Graph Description: test_walk_topdown() attempts to handle all possible visitation orders, but the result is difficult to read. We can enforce a specific order by sorting dirnames. cpython/Lib/test/test_pathlib.py Lin...
X Description: test_walk_topdown() attempts to handle all possible visitation orders, but the result is difficult to read. We can enforce a specific order by sorting dirnames. cpython/Lib/test/test_pathlib.py Lin...
Opengraph URL: https://github.com/python/cpython/issues/103517
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tests for `pathlib.Path.walk()` are a little fragile","articleBody":"`test_walk_topdown()` attempts to handle all possible visitation orders, but the result is difficult to read. We can enforce a specific order by sorting `dirnames`.\r\n\r\nhttps://github.com/python/cpython/blob/a6f95941a3d686707fb38e0f37758e666f25e180/Lib/test/test_pathlib.py#L2680-L2694\r\n\r\n`test_walk_bottom_up()` suffers similar problems, and also makes unjustified assertions about the order that siblings are visited (which is arbitrary and cannot be influenced by the user, contrary to top-down mode). It can be simplified to ensure that children are yielded before parents.\r\n\r\nhttps://github.com/python/cpython/blob/a6f95941a3d686707fb38e0f37758e666f25e180/Lib/test/test_pathlib.py#L2717-L2735\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103518\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-04-13T16:28:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/103517/cpython/issues/103517"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a1ae3658-dcd7-c248-fffd-195113e47026 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CE56:2D0964:378105:4C0ACC:6969DA20 |
| html-safe-nonce | a3a80cbfc7ab5caa18de45cd0159c7018ef0ab7d4eb8365e813b1ed12e4a9310 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTU2OjJEMDk2NDozNzgxMDU6NEMwQUNDOjY5NjlEQTIwIiwidmlzaXRvcl9pZCI6IjQ0MzY5NzQwNDM0NDkxMjEzMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b07658a5d6e95add89ca58207a63449c763bdd00f1f8d9b49d9491c2eeb0d7e6 |
| hovercard-subject-tag | issue:1666742428 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/103517/issue_layout |
| twitter:image | https://opengraph.githubassets.com/82e48cb100e193100edb757e5f046a645688da3da518328955962192047bc5d3/python/cpython/issues/103517 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/82e48cb100e193100edb757e5f046a645688da3da518328955962192047bc5d3/python/cpython/issues/103517 |
| og:image:alt | test_walk_topdown() attempts to handle all possible visitation orders, but the result is difficult to read. We can enforce a specific order by sorting dirnames. cpython/Lib/test/test_pathlib.py Lin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | barneygale |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width