Title: gh-92886: Replace assertion statements in `handlers.BaseHandler` to support running with optimizations (`-O`) by jackh-ncl · Pull Request #93231 · python/cpython · GitHub
Open Graph Title: gh-92886: Replace assertion statements in `handlers.BaseHandler` to support running with optimizations (`-O`) by jackh-ncl · Pull Request #93231 · python/cpython
X Title: gh-92886: Replace assertion statements in `handlers.BaseHandler` to support running with optimizations (`-O`) by jackh-ncl · Pull Request #93231 · python/cpython
Description: Replace assert statements with raise AssertionError() so that behaviour is maintained and test_wsgiref.py tests pass while running with optimizations (-O). #92886 Before: $ ./python.exe -Om unittest test.test_wsgiref .......................FFF........... ====================================================================== FAIL: test_status_validation_errors (test.test_wsgiref.IntegrationTests.test_status_validation_errors) (status='200') ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/.../dev/cpython/Lib/test/test_wsgiref.py", line 177, in test_status_validation_errors self.assertTrue(out.endswith( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: False is not true ====================================================================== FAIL: test_status_validation_errors (test.test_wsgiref.IntegrationTests.test_status_validation_errors) (status='20X OK') ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/.../dev/cpython/Lib/test/test_wsgiref.py", line 177, in test_status_validation_errors self.assertTrue(out.endswith( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: False is not true ====================================================================== FAIL: test_status_validation_errors (test.test_wsgiref.IntegrationTests.test_status_validation_errors) (status='200OK') ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/.../dev/cpython/Lib/test/test_wsgiref.py", line 177, in test_status_validation_errors self.assertTrue(out.endswith( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: False is not true ---------------------------------------------------------------------- Ran 35 tests in 0.039s FAILED (failures=3) After: $ ./python.exe -Om unittest test.test_wsgiref ................................... ---------------------------------------------------------------------- Ran 35 tests in 0.030s OK Issue: gh-92886
Open Graph Description: Replace assert statements with raise AssertionError() so that behaviour is maintained and test_wsgiref.py tests pass while running with optimizations (-O). #92886 Before: $ ./python.exe -Om unittes...
X Description: Replace assert statements with raise AssertionError() so that behaviour is maintained and test_wsgiref.py tests pass while running with optimizations (-O). #92886 Before: $ ./python.exe -Om unittes...
Opengraph URL: https://github.com/python/cpython/pull/93231
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:be1f0e42-3357-07c4-83e8-e57dd60aefde |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B300:6F9CA:3BCFB2:5001A5:6969C28F |
| html-safe-nonce | 6f18ae3ddb4d89d5465a6d42e57419355be0d68d9dc98d3539916a0b05057618 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzAwOjZGOUNBOjNCQ0ZCMjo1MDAxQTU6Njk2OUMyOEYiLCJ2aXNpdG9yX2lkIjoiMjY2Nzk5NTg5NDYyNjUwMTI2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0dec073834266dac8fd0de0be0cb66494f4727d222e207d0619ada6d5e0af5f5 |
| hovercard-subject-tag | pull_request:947595153 |
| 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/python/cpython/pull/93231/files |
| twitter:image | https://avatars.githubusercontent.com/u/1750152?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1750152?s=400&v=4 |
| og:image:alt | Replace assert statements with raise AssertionError() so that behaviour is maintained and test_wsgiref.py tests pass while running with optimizations (-O). #92886 Before: $ ./python.exe -Om unittes... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width