Title: Remove `check_string` and `check_mapping` from `test_xml_etree` · Issue #100933 · python/cpython · GitHub
Open Graph Title: Remove `check_string` and `check_mapping` from `test_xml_etree` · Issue #100933 · python/cpython
X Title: Remove `check_string` and `check_mapping` from `test_xml_etree` · Issue #100933 · python/cpython
Description: Right now one test in test_xml_etree contains two helpers called check_mapping and check_string: cpython/Lib/test/test_xml_etree.py Lines 206 to 241 in 8dd2766 def check_string(string): len(string) for char in string: self.assertEqual(le...
Open Graph Description: Right now one test in test_xml_etree contains two helpers called check_mapping and check_string: cpython/Lib/test/test_xml_etree.py Lines 206 to 241 in 8dd2766 def check_string(string): len(string)...
X Description: Right now one test in test_xml_etree contains two helpers called check_mapping and check_string: cpython/Lib/test/test_xml_etree.py Lines 206 to 241 in 8dd2766 def check_string(string): len(string)...
Opengraph URL: https://github.com/python/cpython/issues/100933
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove `check_string` and `check_mapping` from `test_xml_etree`","articleBody":"Right now one test in `test_xml_etree` contains two helpers called `check_mapping` and `check_string`:\r\n\r\nhttps://github.com/python/cpython/blob/8dd2766d99f8f51ad62dc0fde8282483590c6cd0/Lib/test/test_xml_etree.py#L206-L241\r\n\r\nIt originates from very old code: https://github.com/python/cpython/blob/d9a550b5e14db2748f4fe089c2637c3462ad7d8d/Lib/test/test_xml_etree.py#L140-L169\r\n\r\nIt is half-baked with lots of obvious things to be improved.\r\n\r\nI think that it is safe just to replace them with:\r\n- `check_string` to `assertIsInstance(str)`\r\n- `check_mapping` to `assertIsInstance(dict)`\r\n\r\nIt is more correct, because both Python and C implementations only use `str` and `dict` for checked attributes. And in this case we can skip re-inventing tests for mapping and string.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-100934\n* gh-101686\n* gh-101687\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2023-01-11T09:59:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/100933/cpython/issues/100933"}
| 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:39706e35-5f55-7443-f2be-de153216871b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AECC:2542A6:1568D30:1D3D013:69694CD3 |
| html-safe-nonce | 210428f6f1687d68b47b69cb106c7a03d8cd36ef9b12140e746cccd91ac22664 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUNDOjI1NDJBNjoxNTY4RDMwOjFEM0QwMTM6Njk2OTRDRDMiLCJ2aXNpdG9yX2lkIjoiNzgyMDMxNzM5ODI0ODU0MTM5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 58911eb84abd937f538cd306e2c2b585ced8a04afd9ae49e3bf2bc4dd4ac9790 |
| hovercard-subject-tag | issue:1528748256 |
| 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/100933/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c86853ab43e415e32ee18efc51ef8e89fc1526ab6c3735f892ee51a89178216/python/cpython/issues/100933 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c86853ab43e415e32ee18efc51ef8e89fc1526ab6c3735f892ee51a89178216/python/cpython/issues/100933 |
| og:image:alt | Right now one test in test_xml_etree contains two helpers called check_mapping and check_string: cpython/Lib/test/test_xml_etree.py Lines 206 to 241 in 8dd2766 def check_string(string): len(string)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| 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 | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width