GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-134567: Exposes log format to users in unittest.TestCase.assertLogs by garry-cairns · Pull Request #134570 · python/cpython Conversation
|
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"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 an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please update also What's New and the versionchanged directive.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Can you clarify what's outstanding here? I thought I had addressed these with the previous commit. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
They still contain "so your assertions can match". You only changed the NEWS entry.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ah got you, should be sorted now. Thanks for all your help and attention on this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
LGTM. 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
The reason will be displayed to describe this comment to others. Learn more.
@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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the noise on this. I've created #136630 to resolve this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.