Skip to content
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