gh-111201: Skip pyrepl Windows tests earlier (#119848)
Don't attempt to load pyrepl Windows console if platforms others than
Windows. For example, the import can fail if ctypes is missing.
(cherry picked from commit
91601a55964fdb3c02b21fa3c8dc629daff2390f)
-import itertools
import sys
import unittest
+
+if sys.platform != 'win32':
+ raise unittest.SkipTest("test only relevant on win32")
+
+
+import itertools
from functools import partial
from typing import Iterable
from unittest import TestCase
pass
-@unittest.skipIf(sys.platform != "win32", "Test class specifically for Windows")
class WindowsConsoleTests(TestCase):
def console(self, events, **kwargs) -> Console:
console = WindowsConsole()