Title: Test `test_inspect` fails with `-OO` · Issue #116780 · python/cpython · GitHub
Open Graph Title: Test `test_inspect` fails with `-OO` · Issue #116780 · python/cpython
X Title: Test `test_inspect` fails with `-OO` · Issue #116780 · python/cpython
Description: Bug report ====================================================================== FAIL: test_class_inside_conditional (test.test_inspect.test_inspect.TestBuggyCases.test_class_inside_conditional) -----------------------------------------...
Open Graph Description: Bug report ====================================================================== FAIL: test_class_inside_conditional (test.test_inspect.test_inspect.TestBuggyCases.test_class_inside_conditional) -...
X Description: Bug report ====================================================================== FAIL: test_class_inside_conditional (test.test_inspect.test_inspect.TestBuggyCases.test_class_inside_conditional) -...
Opengraph URL: https://github.com/python/cpython/issues/116780
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test `test_inspect` fails with `-OO`","articleBody":"# Bug report\n\n```\n======================================================================\nFAIL: test_class_inside_conditional (test.test_inspect.test_inspect.TestBuggyCases.test_class_inside_conditional)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/Users/sobolev/Desktop/cpython2/Lib/test/test_inspect/test_inspect.py\", line 995, in test_class_inside_conditional\n self.assertSourceEqual(mod2.cls238.cls239, 239, 240)\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/sobolev/Desktop/cpython2/Lib/test/test_inspect/test_inspect.py\", line 550, in assertSourceEqual\n self.assertEqual(inspect.getsource(obj),\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^\n self.sourcerange(top, bottom))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: \" class cls239:\\n '''else clause 239'''\\n pass\\n\" != \" class cls239:\\n '''if clause cls239'''\\n\"\n class cls239:\n- '''else clause 239'''\n? ^^^^\n+ '''if clause cls239'''\n? ^^ +++\n- pass\n\n\n======================================================================\nFAIL: test_base_class_have_text_signature (test.test_inspect.test_inspect.TestSignatureDefinitions.test_base_class_have_text_signature)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/Users/sobolev/Desktop/cpython2/Lib/test/test_inspect/test_inspect.py\", line 5315, in test_base_class_have_text_signature\n self.assertEqual(text_signature, '(raw, buffer_size=DEFAULT_BUFFER_SIZE)')\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: None != '(raw, buffer_size=DEFAULT_BUFFER_SIZE)'\n\n----------------------------------------------------------------------\nRan 297 tests in 0.536s\n```\n\nI will send a PR.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-116788\n* gh-116799\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2024-03-14T08:27:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/116780/cpython/issues/116780"}
| 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:4be8235c-c300-d537-935e-fbbece5cc391 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEF0:35E99C:A58B:D5B6:6A53203E |
| html-safe-nonce | c46e8c7a4a351cd35f19236329e503ae9ceb9d1a1357eb5e6b2fa4ae6fc2835d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUYwOjM1RTk5QzpBNThCOkQ1QjY6NkE1MzIwM0UiLCJ2aXNpdG9yX2lkIjoiNzQ1OTI0MTEzNDA3MTY4NTE4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 62fb5fcb05f97d5263532e27e534ff648856b69db78b504b45c66f81c1cdb4e0 |
| hovercard-subject-tag | issue:2185737506 |
| 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/116780/issue_layout |
| twitter:image | https://opengraph.githubassets.com/efbeda425c5db43c2faded9b2437b24089af80955ec2b2905e9518adbf4e0e51/python/cpython/issues/116780 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/efbeda425c5db43c2faded9b2437b24089af80955ec2b2905e9518adbf4e0e51/python/cpython/issues/116780 |
| og:image:alt | Bug report ====================================================================== FAIL: test_class_inside_conditional (test.test_inspect.test_inspect.TestBuggyCases.test_class_inside_conditional) -... |
| 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 | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width