]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-114561: Mark some tests in `test_wincosoleio` with `requires_resource('console...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 25 Jan 2024 20:18:23 +0000 (21:18 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2024 20:18:23 +0000 (20:18 +0000)
(cherry picked from commit 33ae9895d4ac0d88447e529038bc4725ddd8c291)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Lib/test/test_winconsoleio.py

index 70a85552cc03b01ab37bce4defa964e7ceb7ee5a..cf8b105823b26221191e25abd7e610fc02330af8 100644 (file)
@@ -6,7 +6,7 @@ import os
 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")
@@ -140,6 +140,7 @@ class WindowsConsoleIOTests(unittest.TestCase):
             sys.stdin = old_stdin
         self.assertEqual(actual, text)
 
+    @requires_resource('console')
     def test_input(self):
         # ASCII
         self.assertStdinRoundTrip('abc123')
@@ -154,6 +155,7 @@ class WindowsConsoleIOTests(unittest.TestCase):
         # 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
@@ -189,6 +191,7 @@ class WindowsConsoleIOTests(unittest.TestCase):
 
                 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')