Skip to content
Merged
Prev Previous commit
Next Next commit
Adjust the test
The patch decorator was being called even on the skipped test.
  • Loading branch information
encukou committed Feb 14, 2025
commit 2867297628b6b9d4ce988218d032a9404703abc6
8 changes: 4 additions & 4 deletions Lib/test/test_pyrepl/test_eventqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import unittest
import sys
from unittest.mock import patch
from test import support

try:
from _pyrepl.console import Event
Expand Down Expand Up @@ -123,10 +124,10 @@ def test_push_unrecognized_escape_sequence(self):
self.assertEqual(eq.events[2].data, "Z")


@unittest.skipIf(sys.platform == "win32", "No Unix event queue on Windows")
@patch("_pyrepl.curses.tigetstr", lambda x: b"")
@unittest.skipIf(support.MS_WINDOWS, "No Unix event queue on Windows")
class TestUnixEventQueue(EventQueueTestBase, unittest.TestCase):
def setUp(self):
self.enterContext(patch("_pyrepl.curses.tigetstr", lambda x: b""))
self.file = tempfile.TemporaryFile()

def tearDown(self) -> None:
Expand All @@ -136,8 +137,7 @@ def make_eventqueue(self) -> base_eventqueue.BaseEventQueue:
return unix_eventqueue.EventQueue(self.file.fileno(), "utf-8")


@unittest.skipIf(sys.platform != "win32", "No Windows event queue on Unix")
@patch("_pyrepl.curses.tigetstr", lambda x: b"")
@unittest.skipUnless(support.MS_WINDOWS, "No Windows event queue on Unix")
class TestWindowsEventQueue(EventQueueTestBase, unittest.TestCase):
def make_eventqueue(self) -> base_eventqueue.BaseEventQueue:
return windows_eventqueue.EventQueue("utf-8")