Skip to content

Conversation

tpburns
Copy link
Contributor

@tpburns tpburns commented Jun 7, 2025

See test_regrtest TestColorized and test_pdb PdbTestColorize for similar tests with safe setups.

with unittest.mock.patch(
"_colorize.can_colorize", return_value=True
):
result = results.get_state(fail_env_changed=False)

cpython/Lib/test/test_pdb.py

Lines 4694 to 4701 in 24069fb

def setUp(self):
self._original_can_colorize = _colorize.can_colorize
# Force colorize to be enabled because we are sending data
# to a StringIO
_colorize.can_colorize = lambda *args, **kwargs: True
def tearDown(self):
_colorize.can_colorize = self._original_can_colorize

@picnixz picnixz changed the title gh-135237 Add tearDown for _colorize.can_colorize modification in test_argparse gh-135237: Add tearDown for _colorize.can_colorize modification in test_argparse Jun 7, 2025
@sobolevn sobolevn added the needs backport to 3.14 bugs and security fixes label Jun 7, 2025
@sobolevn sobolevn removed the needs backport to 3.14 bugs and security fixes label Jun 7, 2025
@picnixz picnixz changed the title gh-135237: Add tearDown for _colorize.can_colorize modification in test_argparse gh-135237: fix setUp/tearDown of _colorize.can_colorize in test_argparse Jun 7, 2025
@ZeroIntensity ZeroIntensity added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 7, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit e27c90b 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135238%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 7, 2025
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Buildbot failures are unrelated

@hugovk
Copy link
Member

hugovk commented Oct 12, 2025

Closing re: #135237 (comment)

Thanks anyway!

@hugovk hugovk closed this Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants