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

gh-129363: Change regrtest sequential mode output #129476

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented 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.

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
Member Author

cc @hugovk @Yhg1s

@hugovk
Copy link
Member

hugovk commented Jan 31, 2025

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
Copy link
Member Author

vstinner commented Feb 5, 2025

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
Copy link
Member Author

vstinner commented Feb 6, 2025

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
Member Author

@hugovk prefers this PR, so I reopen it.

Copy link
Member

@hugovk hugovk left a comment

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 bug and 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
56 checks passed
@vstinner vstinner deleted the regrtest_sequential branch February 21, 2025 13:55
@miss-islington-app
Copy link

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 <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Feb 21, 2025

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 <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 21, 2025
@bedevere-app
Copy link

bedevere-app bot commented Feb 21, 2025

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 bug and 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 <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
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 <[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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants