Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Update Lib/test/test__colorize.py
  • Loading branch information
hroncok authored Nov 19, 2025
commit 731f2e337b9a6bc7696f190f2f9a316d7b11a0de
2 changes: 1 addition & 1 deletion Lib/test/test__colorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_colorized_detection_checks_for_file(self):

# The documentation for file.fileno says:
# > An OSError is raised if the IO object does not use a file descriptor.
# See https://github.com/python/cpython/issues/141570
# gh-141570: Check OSError is caught and handled
with unittest.mock.patch("os.isatty", side_effect=ZeroDivisionError):
Comment thread
hroncok marked this conversation as resolved.
file = unittest.mock.MagicMock()
file.fileno.side_effect = OSError
Expand Down
Loading