Skip to content

Commit 8cff807

Browse files
gh-114561: Mark some tests in test_wincosoleio with requires_resource('console') decorator (GH-114565)
(cherry picked from commit 33ae989) Co-authored-by: Kirill Podoprigora <[email protected]>
1 parent 709f17b commit 8cff807

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_winconsoleio.py

+4-1
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")
@@ -140,6 +140,7 @@ def assertStdinRoundTrip(self, text):
140140
sys.stdin = old_stdin
141141
self.assertEqual(actual, text)
142142

143+
@requires_resource('console')
143144
def test_input(self):
144145
# ASCII
145146
self.assertStdinRoundTrip('abc123')
@@ -154,6 +155,7 @@ def test_input_nonbmp(self):
154155
# Non-BMP
155156
self.assertStdinRoundTrip('\U00100000\U0010ffff\U0010fffd')
156157

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

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

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

0 commit comments

Comments
 (0)