Skip to content

[3.11] gh-114561: Mark some tests in test_wincosoleio with requires_resource('console') decorator (GH-114565) #114567

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 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Lib/test/test_winconsoleio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import tempfile
import unittest
from test.support import os_helper
from test.support import os_helper, requires_resource

if sys.platform != 'win32':
raise unittest.SkipTest("test only relevant on win32")
Expand Down Expand Up @@ -140,6 +140,7 @@ def assertStdinRoundTrip(self, text):
sys.stdin = old_stdin
self.assertEqual(actual, text)

@requires_resource('console')
def test_input(self):
# ASCII
self.assertStdinRoundTrip('abc123')
Expand All @@ -154,6 +155,7 @@ def test_input_nonbmp(self):
# Non-BMP
self.assertStdinRoundTrip('\U00100000\U0010ffff\U0010fffd')

@requires_resource('console')
def test_partial_reads(self):
# Test that reading less than 1 full character works when stdin
# contains multibyte UTF-8 sequences
Expand Down Expand Up @@ -189,6 +191,7 @@ def test_partial_surrogate_reads(self):

self.assertEqual(actual, expected, 'stdin.read({})'.format(read_count))

@requires_resource('console')
def test_ctrl_z(self):
with open('CONIN$', 'rb', buffering=0) as stdin:
source = '\xC4\x1A\r\n'.encode('utf-16-le')
Expand Down