summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-06-01 21:21:13 (GMT)
committerGitHub <noreply@github.com>2024-06-01 21:21:13 (GMT)
commitac35d9621ba1defdc950ffc188a423ae840368ad (patch)
treefd8a07f8c362ba335dc69fb0852facb4748f13ff
parent225c3cd6c1b2e768f1c879c271b48ec27a99cb5b (diff)
downloadcpython-ac35d9621ba1defdc950ffc188a423ae840368ad.zip
cpython-ac35d9621ba1defdc950ffc188a423ae840368ad.tar.gz
cpython-ac35d9621ba1defdc950ffc188a423ae840368ad.tar.bz2
[3.13] gh-111201: Skip pyrepl Windows tests earlier (#119848) (#119924)
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)
-rw-r--r--Lib/test/test_pyrepl/test_windows_console.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_pyrepl/test_windows_console.py b/Lib/test/test_pyrepl/test_windows_console.py
index 0b90142..e52a54d 100644
--- a/Lib/test/test_pyrepl/test_windows_console.py
+++ b/Lib/test/test_pyrepl/test_windows_console.py
@@ -1,6 +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
@@ -22,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()