GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve tests for _colorize.can_colorize() by serhiy-storchaka · Pull Request #129234 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 23, 2025

Copy link
Copy Markdown
Member

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
Improve tests for _colorize.can_colorize()
8e64217
@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir skip issue needs backport to 3.13 only security fixes labels Jan 23, 2025
@serhiy-storchaka
serhiy-storchaka requested a review from hugovk January 23, 2025 17:37
@serhiy-storchaka serhiy-storchaka added the skip news label Jan 23, 2025
@serhiy-storchaka serhiy-storchaka mentioned this pull request Jan 23, 2025
gh-129061: Fix FORCE_COLOR and NO_COLOR when empty strings #129140
Merged
serhiy-storchaka added 2 commits January 23, 2025 20:23
@serhiy-storchaka
Fix test on Windows.
3b870a6
@serhiy-storchaka
Merge branch 'main' into test__colorize
d7bac3f
@serhiy-storchaka
serhiy-storchaka marked this pull request as ready for review January 23, 2025 18:24
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 23, 2025
@serhiy-storchaka
Fix a test again.
be47b1b
hugovk
hugovk approved these changes Jan 24, 2025
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, looks good.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test__colorize.py
import unittest
import unittest.mock
import _colorize
from test.support import force_not_colorized, make_clean_env

@hugovk hugovk Jan 24, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Jan 24, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/test/test__colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jan 24, 2025
@serhiy-storchaka @hugovk
Update Lib/test/test__colorize.py
5c2c829
Co-authored-by: Hugo van Kemenade <[email protected]>
@hugovk
hugovk merged commit 7907203 into python:main Jan 24, 2025
@miss-islington-app

miss-islington-app Bot commented Jan 24, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 24, 2025
@hugovk

hugovk commented Jan 24, 2025

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 24, 2025
@serhiy-storchaka @hugovk @miss-islington
Improve tests for _colorize.can_colorize() (pythonGH-129234)
2993cfe
(cherry picked from commit 7907203)

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

bedevere-app Bot commented Jan 24, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jan 24, 2025
serhiy-storchaka added a commit that referenced this pull request Jan 24, 2025
@miss-islington @serhiy-storchaka @hugovk
[3.13] Improve tests for _colorize.can_colorize() (GH-129234) (GH-129265
e07a6fe
)

(cherry picked from commit 7907203)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@serhiy-storchaka
serhiy-storchaka deleted the test__colorize branch July 1, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@serhiy-storchaka @hugovk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.