Skip to content

Improve tests for _colorize.can_colorize() #129234

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

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

serhiy-storchaka
Copy link
Member

No description provided.

@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review January 23, 2025 18:24
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, looks good.

import sys
import unittest
import unittest.mock
import _colorize
from test.support import force_not_colorized, make_clean_env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make_clean_env was moved to test.support from the PyREPL tests for use in this file (in #127877).

If we're not using it here any more, should we move it back, or leave it in case it's useful for others later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know. I tried to use make_clean_env(), but we need to remove also NO_COLOR. On other hand, the only PYTHON* variable that needs to be removed is PYTHON_COLORS. Let it be there for now, and then we'll see.

Co-authored-by: Hugo van Kemenade <[email protected]>
@hugovk hugovk merged commit 7907203 into python:main Jan 24, 2025
37 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@hugovk
Copy link
Member

hugovk commented Jan 24, 2025

Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 24, 2025
(cherry picked from commit 7907203)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jan 24, 2025

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jan 24, 2025
serhiy-storchaka added a commit that referenced this pull request Jan 24, 2025
)

(cherry picked from commit 7907203)

Co-authored-by: Serhiy Storchaka <[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
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants