Skip to content

python -m test color print with and without -j #129363

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

Closed
MarcinKonowalczyk opened this issue Jan 27, 2025 · 1 comment
Closed

python -m test color print with and without -j #129363

MarcinKonowalczyk opened this issue Jan 27, 2025 · 1 comment
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@MarcinKonowalczyk
Copy link

MarcinKonowalczyk commented Jan 27, 2025

Bug report

Bug description:

./python.exe -m test -j4 prints test results in color. ./python.exe -m test does not. I'm assuming that the -j behaviour is the intended one, as that's the basic instruction in the dev guide.

Having looked at the code, looks like Regrtest::run_tests_sequentially is a tiny bit outdated. I'll submit a PR for consideration in a bit (submitting issue to get an issue number).

Here is an asciinema link demonstrating the behaviour.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@MarcinKonowalczyk MarcinKonowalczyk added the type-bug An unexpected behavior, bug, or error label Jan 27, 2025
@encukou encukou added the tests Tests in the Lib/test dir label Jan 27, 2025
@hugovk hugovk added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Jan 30, 2025
@hugovk
Copy link
Member

hugovk commented Jan 30, 2025

./python.exe -m test -j4 prints test results in color. ./python.exe -m test does not.

./python.exe -m test does print test results in colour, but it only prints success results for slow tests, so this is technically a feature. More at #129364 (review).

Anyway, this only affects 3.14 so the in practice the distinction doesn't affect bugfix backports :)

vstinner added a commit to vstinner/cpython that referenced this issue Jan 30, 2025
First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
vstinner added a commit to vstinner/cpython that referenced this issue Feb 5, 2025
Always display the previous test, even if it passed in less than
30 seconds.
vstinner added a commit that referenced this issue Feb 21, 2025
First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.

Co-authored-by: Hugo van Kemenade <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 21, 2025
)

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c4)

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 21, 2025
)

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c4)

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
vstinner added a commit that referenced this issue Feb 21, 2025
…130406)

gh-129363: Change regrtest sequential mode output (GH-129476)

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c4)

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
vstinner added a commit that referenced this issue Feb 21, 2025
…130405)

gh-129363: Change regrtest sequential mode output (GH-129476)

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c4)

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
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 type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants