| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The interactive profile browser started by ``python -m pstats`` had no tests. Drive it through a subprocess and check each documented command, the prompts, the report header, sorting, restrictions, callers and callees, help, and the error paths.
|
Dropped the NEWS entry: this changes only tests, which the devguide lists among the exemptions. The same point was made on #157171 ("This is a fix to unreleased test. It does not need a NEWS entry") and on #157158, so I am applying it across my open test-only PRs rather than having it raised on each one. bedevere/news will stay red until skip news is applied. (Edited to remove two user mentions that pinged core developers for no reason. Sorry for the noise.) |
Sorry, something went wrong.
|
You should not ping core devs unnecessarily. |
Sorry, something went wrong.
|
You are right, sorry. I mentioned two core developers by name across three PRs to explain where the convention came from, which pinged you both for nothing. I have edited those comments to reference the PR numbers instead, and I will link to the discussion rather than name people from now on. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Adds tests for the interactive profile browser started by python -m pstats, which had none (test_pstats.py only covered the Stats API).
The browser only exists inside the module's __main__ block, so the tests run it in a subprocess with script_helper.spawn_python() and feed commands on stdin. A small profile is generated once per class with cProfile from two module-level functions, one of which calls the other three times, so the expected call counts, callers and callees are known.
Covered:
Assertions avoid anything timing-dependent: they check call counts, the relative order of the two known functions, and the exact messages printed by the browser. The class is guarded with support.requires_subprocess(). The 20 new tests take about 1.2 s on a debug build here.
Ran test_pstats repeatedly, make patchcheck and the pre-commit hooks on macOS.