Skip to content

Conversation

@loic-simon
Copy link
Contributor

@loic-simon loic-simon commented Dec 28, 2025

(split from #140871 as recommanded by @tomasr8)

Add a few tests to get the coverage rate of _pyrepl._module_completer to ~100%:

% python -m coverage run --branch --source=_pyrepl._module_completer -m unittest Lib/test/test_pyrepl/test_pyrepl.py
.....................................s..................................................
----------------------------------------------------------------------
Ran 88 tests in 2.369s

OK (skipped=1)

% python -m coverage report --show-missing
Name                               Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------
Lib/_pyrepl/_module_completer.py     267      1    104      1    99%   19
------------------------------------------------------------------------------
TOTAL                                267      1    104      1    99%

The only statement left is the import under if TYPE_CHECKING, as expected.

Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! The All required checks pass failed for some reason so I'm just gonna merge main to trigger a new run..

@tomasr8 tomasr8 added the needs backport to 3.14 bugs and security fixes label Dec 28, 2025
@tomasr8 tomasr8 merged commit c3febba into python:main Dec 28, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks @loic-simon for the PR, and @tomasr8 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 28, 2025
…H-143244)

Full coverage for _pyrepl._module_completer
(cherry picked from commit c3febba)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 28, 2025

GH-143260 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 28, 2025
tomasr8 added a commit that referenced this pull request Dec 28, 2025
) (#143260)

gh-140870: Full coverage for _pyrepl._module_completer (GH-143244)

Full coverage for _pyrepl._module_completer
(cherry picked from commit c3febba)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
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.

2 participants