Skip to content

Commit

Permalink
pythongh-108996: fix and enable test_msvcrt
Browse files Browse the repository at this point in the history
  • Loading branch information
aisk committed Sep 10, 2023
1 parent 2dd6a86 commit c8d3c3f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Lib/test/test_msvcrt.py
@@ -1,9 +1,8 @@
import ctypes
import os
import sys
import unittest

raise unittest.SkipTest("FIXME! broken test see: https://github.com/python/cpython/pull/109004")

from test.support import os_helper
from test.support.os_helper import TESTFN, TESTFN_ASCII

Expand Down Expand Up @@ -63,6 +62,12 @@ def test_get_osfhandle(self):


class TestConsoleIO(unittest.TestCase):
def setUp(self):
# The stdin may have left over contents by other tests (especially test_winconsoleio),
# so flush it before every test case.
h = msvcrt.get_osfhandle(sys.stdin.fileno())
ctypes.windll.kernel32.FlushConsoleInputBuffer(h)

def test_kbhit(self):
self.assertEqual(msvcrt.kbhit(), 0)

Expand Down

0 comments on commit c8d3c3f

Please sign in to comment.