Title: Fix logging error message by larsoner · Pull Request #22276 · python/cpython · GitHub
Open Graph Title: Fix logging error message by larsoner · Pull Request #22276 · python/cpython
X Title: Fix logging error message by larsoner · Pull Request #22276 · python/cpython
Description: Not 100% sure if this needs an issue since I considered it trivial at first -- master has this pattern: raise ValueError("Unknown level: %r" % level) this fails if level is a tuple. This PR switches to f-string, but an alternative to keep % would be just to do % (level,). But when implementing a test by reusing assert_error_message I noticed that assert_error_message was not doing what I think it was intended to do -- it never really checked to make sure the emitted error message actually matched the given error message. So I refactored it to actually check that the error message matched the one passed to assert_error_message, which then required fixing a few existing tests in FormatterTest, as the messages were actually outdated.
Open Graph Description: Not 100% sure if this needs an issue since I considered it trivial at first -- master has this pattern: raise ValueError("Unknown level: %r" % level) this fails if level is a tuple. This...
X Description: Not 100% sure if this needs an issue since I considered it trivial at first -- master has this pattern: raise ValueError("Unknown level: %r" % level) this fails if level is a tup...
Opengraph URL: https://github.com/python/cpython/pull/22276
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ce706fb3-e74c-d721-8751-fdab226a03eb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 91C2:28E6FC:2D5063:40417E:696A4C66 |
| html-safe-nonce | c4135d820dc96c51735e1c5f22a0ff96f0c99f8e4e6daab9671aa3711ac46010 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUMyOjI4RTZGQzoyRDUwNjM6NDA0MTdFOjY5NkE0QzY2IiwidmlzaXRvcl9pZCI6IjYxNjU5MDg3MDAzNDI2NjgzOTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5801dd0d95380edb09137065bab72fb7e6e06103787d75d8a556f4459799f696 |
| hovercard-subject-tag | pull_request:487985668 |
| 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/22276/files |
| twitter:image | https://avatars.githubusercontent.com/u/2365790?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2365790?s=400&v=4 |
| og:image:alt | Not 100% sure if this needs an issue since I considered it trivial at first -- master has this pattern: raise ValueError("Unknown level: %r" % level) this fails if level is a tuple. This... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| 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 | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width