Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
gh-124130: Increase test coverage for \b and \B in regular expressions#124330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-124130: Increase test coverage for \b and \B in regular expressions#124330
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| self.checkPatternError(br'[\N{LESS-THAN SIGN}]',r'bad escape \N',1) | ||
| deftest_string_boundaries(self): | ||
| deftest_word_boundaries(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
[no change needed] I think wecould use subtests to provide more informative context (basically what you've got in each # comment header) when a test fails? but this is already in keeping with the existing style of this file, so not a big deal. these seem to nicely encode the current behavior state of ourre implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The comments provide context to the reader of the code (so you will know where to add new tests), not when a test fails. The traceback already has all necessary context.
subTest() has two functions:
- Provide more informative context when a test fails. This is especially useful when traceback does not identify the failed test (in a loop, with generated test data).
- Allows to continue execution when a test fails and collect information about other test failures in one run. This works only when tests are independent and
subTest()is well granulated.
It has a drawback -- the traceback is limited and can be less informative ifsubTest() is used in a helper.
b82f076 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…essions (pythonGH-124330)(cherry picked from commitb82f076)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-124413 is a backport of this pull request to the3.13 branch. |
…essions (pythonGH-124330)(cherry picked from commitb82f076)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-124414 is a backport of this pull request to the3.12 branch. |
Uh oh!
There was an error while loading.Please reload this page.