Skip to content

Commit 44ef80a

Browse files
committed
add requires_resource
1 parent a0d2972 commit 44ef80a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_msvcrt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import unittest
55
from textwrap import dedent
66

7-
from test.support import os_helper
7+
from test.support import os_helper, requires_resource
88
from test.support.os_helper import TESTFN, TESTFN_ASCII
99

1010
if sys.platform != "win32":
@@ -69,6 +69,7 @@ def run_in_separated_process(self, code):
6969
creationflags=subprocess.CREATE_NEW_CONSOLE)
7070

7171

72+
@requires_resource('gui')
7273
def test_kbhit(self):
7374
code = dedent('''
7475
import msvcrt
@@ -90,13 +91,15 @@ def check_getwch(self, funcname):
9091
''')
9192
self.run_in_separated_process(code)
9293

94+
@requires_resource('gui')
9395
def test_getwch(self):
9496
self.check_getwch('getwch')
9597

9698
def test_getche(self):
9799
msvcrt.ungetch(b'c')
98100
self.assertEqual(msvcrt.getche(), b'c')
99101

102+
@requires_resource('gui')
100103
def test_getwche(self):
101104
self.check_getwch('getwche')
102105

0 commit comments

Comments
 (0)