Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedSep 23, 2024
edited by bedevere-appbot
Loading

@serhiy-storchakaserhiy-storchaka added testsTests in the Lib/test dir needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsSep 23, 2024
self.checkPatternError(br'[\N{LESS-THAN SIGN}]',r'bad escape \N',1)

deftest_string_boundaries(self):
deftest_word_boundaries(self):
Copy link
Member

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.

Copy link
MemberAuthor

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 andsubTest() is well granulated.

It has a drawback -- the traceback is limited and can be less informative ifsubTest() is used in a helper.

@serhiy-storchakaserhiy-storchakaenabled auto-merge (squash)September 24, 2024 06:06
@serhiy-storchakaserhiy-storchaka merged commitb82f076 intopython:mainSep 24, 2024
28 checks passed
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 24, 2024
…essions (pythonGH-124330)(cherry picked from commitb82f076)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

GH-124413 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 24, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 24, 2024
…essions (pythonGH-124330)(cherry picked from commitb82f076)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

GH-124414 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelSep 24, 2024
serhiy-storchaka added a commit that referenced this pull requestSep 24, 2024
…ressions (GH-124330) (GH-124414)(cherry picked from commitb82f076)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull requestOct 7, 2024
…ressions (GH-124330) (GH-124413)(cherry picked from commitb82f076)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchakaserhiy-storchaka deleted the test-re-word-boundaries branchOctober 21, 2024 13:41
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees

No one assigned

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@serhiy-storchaka@gpshead@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp