Skip to content

gh-129363: Change regrtest sequential mode output#129476

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:regrtest_sequential
Feb 21, 2025
Merged

gh-129363: Change regrtest sequential mode output#129476
vstinner merged 2 commits into
python:mainfrom
vstinner:regrtest_sequential

Conversation

@vstinner

@vstinner vstinner commented Jan 30, 2025

Copy link
Copy Markdown
Member

First, write the test name without color. Then, write the test name and the result with color. Each test is displayed twice.

Example:

Capture d’écran du 2025-01-30 17-05-19

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
@vstinner

Copy link
Copy Markdown
Member Author

cc @hugovk @Yhg1s

@hugovk

hugovk commented Jan 31, 2025

Copy link
Copy Markdown
Member

This is an improvement but will double the length of the logs.

Shall we take inspiration from pytest, which first prints the (uncoloured) name of the test, and then appends the coloured result?

image

So we could do it something like this?

image

@vstinner

vstinner commented Feb 5, 2025

Copy link
Copy Markdown
Member Author

Shall we take inspiration from pytest, which first prints the (uncoloured) name of the test, and then appends the coloured result?

Currently, when a test fails, it's output is written directly. So we cannot just add "passed" or "failed" after running a test.

Example (I added a bug to test_os):

0:00:00 load avg: 0.41 [1/1] test_os
test test_os failed -- Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_os.py", line 188, in test_access
    x
NameError: name 'x' is not defined

0:00:00 load avg: 0.41 [1/1/1] test_os failed (1 error)

@vstinner

vstinner commented Feb 6, 2025

Copy link
Copy Markdown
Member Author

I wrote #129687 instead, I abandon this PR.

@vstinner vstinner closed this Feb 6, 2025
@vstinner vstinner reopened this Feb 20, 2025
@vstinner

Copy link
Copy Markdown
Member Author

@hugovk prefers this PR, so I reopen it.

@hugovk hugovk 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.

Thanks!

@hugovk hugovk added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Feb 21, 2025
@vstinner vstinner merged commit f1b81c4 into python:main Feb 21, 2025
@vstinner vstinner deleted the regrtest_sequential branch February 21, 2025 13:55
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request 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 <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Feb 21, 2025

Copy link
Copy Markdown

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request 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 <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Feb 21, 2025
@bedevere-app

bedevere-app Bot commented Feb 21, 2025

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Feb 21, 2025
vstinner added a commit that referenced this pull request 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 <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
vstinner added a commit that referenced this pull request 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 <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants