]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111201: Skip pyrepl Windows tests earlier (#119848)
authorVictor Stinner <vstinner@python.org>
Fri, 31 May 2024 14:06:10 +0000 (16:06 +0200)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 14:06:10 +0000 (14:06 +0000)
Don't attempt to load pyrepl Windows console if platforms others than
Windows. For example, the import can fail if ctypes is missing.

Lib/test/test_pyrepl/test_windows_console.py

index 60392e231508b61481cb953159ba262b57699fa3..e52a54d31fb5d883c19bff2f49cabd69b6bd6283 100644 (file)
@@ -1,7 +1,11 @@
-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
@@ -23,7 +27,6 @@ except ImportError:
     pass
 
 
-@unittest.skipIf(sys.platform != "win32", "Test class specifically for Windows")
 class WindowsConsoleTests(TestCase):
     def console(self, events, **kwargs) -> Console:
         console = WindowsConsole()