FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-130655: Add tests for `gettext.find()` by StanFromIreland · Pull Request #130691 · python/cpython · GitHub

Repository navigation

gh-130655: Add tests for gettext.find() - #130691

Merged
encukou merged 12 commits into
python:mainfrom
StanFromIreland:find-tests
Mar 19, 2025
Merged

encukou merged 12 commits into
python:mainfrom
StanFromIreland:find-tests

Conversation

StanFromIreland commented Feb 28, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

(There was no coverage before)

bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels Feb 28, 2025
tomasr8 self-requested a review February 28, 2025 18:40

Copy link
Copy Markdown
Member Author

Also request @serhiy-storchaka

tomasr8 commented Feb 28, 2025

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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 commented Feb 28, 2025

Copy link
Copy Markdown
Member

It's important to test these if we're going to touch the behaviour of find 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 where languages == [].

Second line: not sure why it’s yellow

The condition was always True in tests

Copy link
Copy Markdown
Member Author

100% (of find)

Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
StanFromIreland requested a review from encukou March 3, 2025 19:10

tomasr8 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just a few comments/improvements :)

Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py
Comment thread Lib/test/test_gettext.py
StanFromIreland requested a review from tomasr8 March 3, 2025 21:09

tomasr8 commented Mar 10, 2025

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

@tomasr8

Looks pretty green to me :-)

report

tomasr8 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just one more thing, I'd also test that LC_ALL, LC_MESSAGES and LANG are read as well in addition to LANGUAGE.

StanFromIreland requested a review from tomasr8 March 10, 2025 19:08

tomasr8 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks! Looks good :)

Comment thread Lib/test/test_gettext.py Outdated
StanFromIreland and others added 3 commits March 10, 2025 19:41
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 18, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit 9afb57d 🤖

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-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 18, 2025
encukou merged commit 3118693 into python:main Mar 19, 2025
StanFromIreland deleted the find-tests branch March 19, 2025 15:25
colesbury pushed a commit to colesbury/cpython that referenced this pull request Mar 20, 2025
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>

picnixz commented Apr 4, 2025

Copy link
Copy Markdown
Member

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

tomasr8 commented Apr 4, 2025

Copy link
Copy Markdown
Member

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

tomasr8 added needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Apr 4, 2025

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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 request Apr 4, 2025
(cherry picked from commit 3118693)

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 request Apr 4, 2025
(cherry picked from commit 3118693)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>

bedevere-app Bot commented Apr 4, 2025

Copy link
Copy Markdown

GH-132083 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Apr 4, 2025

bedevere-app Bot commented Apr 4, 2025

Copy link
Copy Markdown

GH-132084 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Apr 4, 2025
picnixz pushed a commit that referenced this pull request Apr 4, 2025
gh-130655: Add tests for `gettext.find()` (GH-130691)

(cherry picked from commit 3118693)

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 request Apr 4, 2025
gh-130655: Add tests for `gettext.find()` (GH-130691)

(cherry picked from commit 3118693)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL