mirror of
https://github.com/python/cpython.git
synced 2025-08-11 20:40:27 +00:00
gh-114561: Mark some tests in test_wincosoleio
with requires_resource('console')
decorator (GH-114565)
(cherry picked from commit 33ae9895d4
)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
parent
d2da4e417e
commit
4ff2d29266
1 changed files with 4 additions and 1 deletions
|
@ -6,7 +6,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
from test.support import os_helper
|
from test.support import os_helper, requires_resource
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
raise unittest.SkipTest("test only relevant on win32")
|
raise unittest.SkipTest("test only relevant on win32")
|
||||||
|
@ -140,6 +140,7 @@ class WindowsConsoleIOTests(unittest.TestCase):
|
||||||
sys.stdin = old_stdin
|
sys.stdin = old_stdin
|
||||||
self.assertEqual(actual, text)
|
self.assertEqual(actual, text)
|
||||||
|
|
||||||
|
@requires_resource('console')
|
||||||
def test_input(self):
|
def test_input(self):
|
||||||
# ASCII
|
# ASCII
|
||||||
self.assertStdinRoundTrip('abc123')
|
self.assertStdinRoundTrip('abc123')
|
||||||
|
@ -154,6 +155,7 @@ class WindowsConsoleIOTests(unittest.TestCase):
|
||||||
# Non-BMP
|
# Non-BMP
|
||||||
self.assertStdinRoundTrip('\U00100000\U0010ffff\U0010fffd')
|
self.assertStdinRoundTrip('\U00100000\U0010ffff\U0010fffd')
|
||||||
|
|
||||||
|
@requires_resource('console')
|
||||||
def test_partial_reads(self):
|
def test_partial_reads(self):
|
||||||
# Test that reading less than 1 full character works when stdin
|
# Test that reading less than 1 full character works when stdin
|
||||||
# contains multibyte UTF-8 sequences
|
# contains multibyte UTF-8 sequences
|
||||||
|
@ -189,6 +191,7 @@ class WindowsConsoleIOTests(unittest.TestCase):
|
||||||
|
|
||||||
self.assertEqual(actual, expected, 'stdin.read({})'.format(read_count))
|
self.assertEqual(actual, expected, 'stdin.read({})'.format(read_count))
|
||||||
|
|
||||||
|
@requires_resource('console')
|
||||||
def test_ctrl_z(self):
|
def test_ctrl_z(self):
|
||||||
with open('CONIN$', 'rb', buffering=0) as stdin:
|
with open('CONIN$', 'rb', buffering=0) as stdin:
|
||||||
source = '\xC4\x1A\r\n'.encode('utf-16-le')
|
source = '\xC4\x1A\r\n'.encode('utf-16-le')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue