Skip to content

Commit 33ae989

Browse files
authored
gh-114561: Mark some tests in test_wincosoleio with requires_resource('console') decorator (GH-114565)
1 parent d96358f commit 33ae989

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_winconsoleio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import tempfile
88
import unittest
9-
from test.support import os_helper
9+
from test.support import os_helper, requires_resource
1010

1111
if sys.platform != 'win32':
1212
raise unittest.SkipTest("test only relevant on win32")
@@ -150,6 +150,7 @@ def assertStdinRoundTrip(self, text):
150150
sys.stdin = old_stdin
151151
self.assertEqual(actual, text)
152152

153+
@requires_resource('console')
153154
def test_input(self):
154155
# ASCII
155156
self.assertStdinRoundTrip('abc123')
@@ -164,6 +165,7 @@ def test_input_nonbmp(self):
164165
# Non-BMP
165166
self.assertStdinRoundTrip('\U00100000\U0010ffff\U0010fffd')
166167

168+
@requires_resource('console')
167169
def test_partial_reads(self):
168170
# Test that reading less than 1 full character works when stdin
169171
# contains multibyte UTF-8 sequences
@@ -199,6 +201,7 @@ def test_partial_surrogate_reads(self):
199201

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

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

0 commit comments

Comments
 (0)