| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
|
@ezio-melotti @rbtcollins @gpshead @serhiy-storchaka Does anyone have any bandwidth to look a this one? I believe it will be a fairly quick either accept or reject type change. |
Sorry, something went wrong.
There was a problem hiding this comment.
As a new feature, it needs a documentation. Add a versionchanged directive for assertLogs(), add an entry in the What's New document.
I have no strong opinion about this feature.
Sorry, something went wrong.
There was a problem hiding this comment.
"so your assertions can match a custom format" looks misleading. It can be misinterpreted as if assertLogs() itself checks that logging messages were formatted using the specified formatter. This is not true. assertLogs() does not check what formatter was used for the specified logger. It uses the specified formatter (or the default one) to format logging messages in output.
I suggest simply saying that a formatter is used to format the strings in output.
Sorry, something went wrong.
There was a problem hiding this comment.
Please update also What's New and the versionchanged directive.
Sorry, something went wrong.
Can you clarify what's outstanding here? I thought I had addressed these with the previous commit. |
Sorry, something went wrong.
There was a problem hiding this comment.
They still contain "so your assertions can match". You only changed the NEWS entry.
Sorry, something went wrong.
Ah got you, should be sorted now. Thanks for all your help and attention on this. |
Sorry, something went wrong.
|
LGTM. 👍 |
Sorry, something went wrong.
| unittest | ||
| -------- | ||
|
|
||
| * Lets users specify formatter in TestCase.assertLogs. | ||
| :func:`unittest.TestCase.assertLogs` will now accept a formatter | ||
| to control how messages are formatted. | ||
| (Contributed by Garry Cairns in :gh:`134567`.) |
There was a problem hiding this comment.
@garry-cairns This is under the "Removed" section:
https://docs.python.org/3.15/whatsnew/3.15.html#removed
Please could you move it to the "Improved modules" section above?
https://docs.python.org/3.15/whatsnew/3.15.html#improved-modules
(We could also remove the first sentence "Lets users specify formatter in TestCase.assertLogs", as the next sentence essentially repeats it.)
Sorry, something went wrong.
There was a problem hiding this comment.
Apologies for the noise on this. I've created #136630 to resolve this.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Allows users optionally to pass a custom log formatter to assertLogs such that assertions match expected custom formats where they are used. Existing behavior should be unaffected.