Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break up _pyrepl tests #119306

Closed
eugenetriguba opened this issue May 21, 2024 · 1 comment
Closed

Break up _pyrepl tests #119306

eugenetriguba opened this issue May 21, 2024 · 1 comment
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell

Comments

@eugenetriguba
Copy link
Contributor

eugenetriguba commented May 21, 2024

I'd like to work on increasing the test coverage of the new _pyrepl module:

 % ./python.exe ../coveragepy report --show-missing
Name                               Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------
Lib/_pyrepl/__init__.py                0      0      0      0   100%
Lib/_pyrepl/__main__.py               35     35     16      0     0%   1-44
Lib/_pyrepl/_minimal_curses.py        38     38     12      0     0%   12-68
Lib/_pyrepl/commands.py              294    148     80      3    46%   56, 61-75, 96, 100, 110-126, 131-133, 138, 143-144, 149-157, 162-163, 168-170, 175-177, 182-184, 189-193, 198-211, 216-219, 224-236, 250-252, 286->exit, 309, 326, 331, 336, 341, 346-348, 353-355, 366-367, 372-385, 390-398, 403-418, 423, 428-431, 436-438, 443-444, 449-455
Lib/_pyrepl/completing_reader.py     151     19     52     10    85%   47-48, 66, 79-80, 88->100, 102->116, 174->177, 182-183, 190->192, 197-198, 214, 223, 278-284, 287
Lib/_pyrepl/console.py                33      0     22      0   100%
Lib/_pyrepl/curses.py                 11      5      0      0    55%   24-28
Lib/_pyrepl/fancy_termios.py          25      7      0      0    72%   62-64, 67, 70, 73-74
Lib/_pyrepl/historical_reader.py     215     83     50      7    58%   58-62, 67-71, 76-81, 86, 91, 96, 101-124, 129-134, 149-154, 164->exit, 170-175, 180-182, 187-189, 272, 276-282, 289-292, 296-298, 315, 323-324, 327-329, 341->exit
Lib/_pyrepl/input.py                  59      8     26      5    85%   52, 56, 60, 76, 83, 88, 94, 103
Lib/_pyrepl/keymap.py                 77      9     46      9    85%   126, 131, 138, 143, 159, 165, 172, 181, 210
Lib/_pyrepl/pager.py                 118    118     54      0     0%   1-173
Lib/_pyrepl/reader.py                358     65    130     20    78%   265-267, 271-273, 325-333, 345-354, 362-370, 377->379, 391, 411, 417, 430->432, 459, 477->489, 504->exit, 506, 522-524, 528, 538-546, 553-555, 558-559, 579, 591->594, 611, 622, 627, 633, 639-640, 649, 659-660
Lib/_pyrepl/readline.py              306    129     90     10    54%   122-127, 130->148, 133-134, 139-140, 151-157, 174-181, 186, 192-193, 195, 244->253, 247-252, 257, 273->275, 275->exit, 279-282, 285-291, 298-308, 311, 314, 317, 320, 323, 326-327, 330, 333, 336, 343-360, 363-368, 371, 374-378, 381-385, 389-393, 397, 400, 403-404, 407-413, 416, 419, 422, 463-465, 484-502
Lib/_pyrepl/simple_interact.py        89     68     16      0    22%   41-45, 74-75, 78, 84-158
Lib/_pyrepl/trace.py                  13      5      6      2    53%   12, 18-21
Lib/_pyrepl/types.py                   7      0      0      0   100%
Lib/_pyrepl/unix_console.py          428    161    140     21    61%   47, 112-126, 152, 157, 173, 215, 235, 288-292, 346-347, 355-362, 368-369, 381-397, 403, 412-415, 426-448, 454, 471-476, 482-483, 494-529, 535-539, 545, 551->560, 555-558, 562-565, 569-572, 575, 579, 613-614, 623-626, 636-645, 651, 659, 668->exit, 672-676, 686-687, 690-694, 712-713, 726-735, 752-762
Lib/_pyrepl/unix_eventqueue.py        69      6     20      4    89%   69, 93, 126, 143, 148-149
Lib/_pyrepl/utils.py                  11      0      6      0   100%
------------------------------------------------------------------------------
TOTAL                               2337    904    766     91    59%

However, with all the tests in the single file, it was seeming like it'd start to get unwieldy. As a first step, I'd like to break this test_pyrepl.py file apart.

Linked PRs

eugenetriguba added a commit to eugenetriguba/cpython that referenced this issue May 21, 2024
eugenetriguba added a commit to eugenetriguba/cpython that referenced this issue May 21, 2024
@Eclips4 Eclips4 added tests Tests in the Lib/test dir topic-repl Related to the interactive shell labels May 21, 2024
eugenetriguba added a commit to eugenetriguba/cpython that referenced this issue May 21, 2024
eugenetriguba added a commit to eugenetriguba/cpython that referenced this issue May 21, 2024
@ambv ambv closed this as completed May 21, 2024
@ambv
Copy link
Contributor

ambv commented May 21, 2024

Thanks! ✨ 🍰 ✨

lysnikolaou pushed a commit to lysnikolaou/cpython that referenced this issue May 21, 2024
(cherry picked from commit f49df4f)

Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
lysnikolaou added a commit that referenced this issue May 22, 2024
(cherry picked from commit f49df4f)

Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell
Projects
None yet
Development

No branches or pull requests

3 participants