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-130655: Add tests forgettext.find()#130691

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
encukou merged 12 commits intopython:mainfromStanFromIreland:find-tests
Mar 19, 2025

Conversation

StanFromIreland
Copy link
Contributor

@StanFromIrelandStanFromIreland commentedFeb 28, 2025
edited
Loading

(There was no coverage before)

image

@bedevere-appbedevere-appbot added testsTests in the Lib/test dir awaiting review labelsFeb 28, 2025
@tomasr8tomasr8 self-requested a reviewFebruary 28, 2025 18:40
@StanFromIreland
Copy link
ContributorAuthor

Also request@serhiy-storchaka

@tomasr8
Copy link
Member

Thanks! Could you also add tests that cover the 4 missing lines?

@StanFromIreland
Copy link
ContributorAuthor

First line: I would consider fine as it just breaks on the first run

Second line: not sure why it’s yellow

third line: Is it necessary?

fourth line: returns before reaching c

I don’t see any reason to run a test with just c

@tomasr8
Copy link
Member

It's important to test these if we're going to touch the behaviour offind later. The function is quite complex and I wouldn't feel confident modifying it w/o proper test coverage. Since we're going through the trouble to write tests for it, let's make sure it's all covered :)

First line: I would consider fine as it just breaks on the first run

The loop always breaks which means you never test the case wherelanguages == [].

Second line: not sure why it’s yellow

The condition was alwaysTrue in tests

@StanFromIreland
Copy link
ContributorAuthor

100% (of find)

image

tomasr8 reacted with thumbs up emoji

Copy link
Member

@tomasr8tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just a few comments/improvements :)

@tomasr8
Copy link
Member

Can you double-check that we have full coverage? Otherwise I think it's good :)

@StanFromIreland
Copy link
ContributorAuthor

@tomasr8

Looks pretty green to me :-)

report

image

tomasr8 reacted with thumbs up emoji

Copy link
Member

@tomasr8tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just one more thing, I'd also test thatLC_ALL,LC_MESSAGES andLANG are read as well in addition toLANGUAGE.

Copy link
Member

@tomasr8tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks! Looks good :)

StanFromIreland reacted with heart emoji
StanFromIrelandand others added3 commitsMarch 10, 2025 19:41
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@encukouencukou added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 18, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@encukou for commit9afb57d 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F130691%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 18, 2025
@encukouencukou merged commit3118693 intopython:mainMar 19, 2025
113 of 115 checks passed
@StanFromIrelandStanFromIreland deleted the find-tests branchMarch 19, 2025 15:25
colesbury pushed a commit to colesbury/cpython that referenced this pull requestMar 20, 2025
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@picnixz
Copy link
Member

Do we want to backport them or not by the way?

@tomasr8
Copy link
Member

I think so, similar test PRs were also previously backported.

@tomasr8tomasr8 added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsApr 4, 2025
@miss-islington-app
Copy link

Thanks@StanFromIreland for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks@StanFromIreland for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 4, 2025
(cherry picked from commit3118693)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 4, 2025
(cherry picked from commit3118693)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelApr 4, 2025
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelApr 4, 2025
picnixz pushed a commit that referenced this pull requestApr 4, 2025
gh-130655: Add tests for `gettext.find()` (GH-130691)(cherry picked from commit3118693)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
picnixz pushed a commit that referenced this pull requestApr 4, 2025
gh-130655: Add tests for `gettext.find()` (GH-130691)(cherry picked from commit3118693)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
seehwan pushed a commit to seehwan/cpython that referenced this pull requestApr 16, 2025
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tomasr8tomasr8tomasr8 approved these changes

@encukouencukouAwaiting requested review from encukou

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.

5 participants
@StanFromIreland@tomasr8@bedevere-bot@picnixz@encukou

[8]ページ先頭

©2009-2025 Movatter.jp