Title: Refactor tests to split out common test types · Issue #111673 · python/cpython · GitHub
Open Graph Title: Refactor tests to split out common test types · Issue #111673 · python/cpython
X Title: Refactor tests to split out common test types · Issue #111673 · python/cpython
Description: It is better to not import from one test in other tests, I propose adding a utils module for common types / helpers. Originally posted by @sobolevn in #111624 (comment) For example: cpython/Lib/test/test_complex.py Lines 446 to 450 in 93...
Open Graph Description: It is better to not import from one test in other tests, I propose adding a utils module for common types / helpers. Originally posted by @sobolevn in #111624 (comment) For example: cpython/Lib/tes...
X Description: It is better to not import from one test in other tests, I propose adding a utils module for common types / helpers. Originally posted by @sobolevn in #111624 (comment) For example: cpython/Lib/tes...
Opengraph URL: https://github.com/python/cpython/issues/111673
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Refactor tests to split out common test types","articleBody":"It is better to not import from one test in other tests, I propose adding a `utils` module for common types / helpers.\r\n\r\n_Originally posted by @sobolevn in https://github.com/python/cpython/pull/111624#discussion_r1379928063_\r\n\r\nFor example:\r\nhttps://github.com/python/cpython/blob/93206d19a35106f64a1aef5fa25eb18966970534/Lib/test/test_complex.py#L446-L450\r\nand\r\nhttps://github.com/python/cpython/blob/93206d19a35106f64a1aef5fa25eb18966970534/Lib/test/test_capi/test_getargs.py#L102-L104\r\nhttps://github.com/python/cpython/blob/93206d19a35106f64a1aef5fa25eb18966970534/Lib/test/test_capi/test_getargs.py#L113-L123\r\nwe could unify to:\r\n```python\r\nclass FloatLike:\r\n def __init__(self, value):\r\n self.value = value\r\n\r\n def __float__(self):\r\n return self.value\r\n```\r\n\r\nSuch support classes now scattered e.g. in ``Lib/test_float.py`` and in ``Lib/test_capi/test_getargs.py``.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-110956\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2023-11-03T02:37:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/111673/cpython/issues/111673"}
| 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:c399d014-59c0-f7b2-44c0-e6adcd65c44b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD1E:65407:28CB01:366CE9:6969AA15 |
| html-safe-nonce | dd485f3b6c509c16c357332e8027532e6b57e5960ed160cbb64bafef2f09232c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDFFOjY1NDA3OjI4Q0IwMTozNjZDRTk6Njk2OUFBMTUiLCJ2aXNpdG9yX2lkIjoiNjU0ODAwODIwMjM4MzUwMTg0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b48ebd6612b27f14f60f7b3ee8dbb76ca1a67d23f39975526ee3563f0ff4bf52 |
| hovercard-subject-tag | issue:1975370622 |
| 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/111673/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be27d1b4ad397e0612d2af03a2ec0828783407ddf2d7980e74fdb6343115d837/python/cpython/issues/111673 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be27d1b4ad397e0612d2af03a2ec0828783407ddf2d7980e74fdb6343115d837/python/cpython/issues/111673 |
| og:image:alt | It is better to not import from one test in other tests, I propose adding a utils module for common types / helpers. Originally posted by @sobolevn in #111624 (comment) For example: cpython/Lib/tes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width