From 95fb46c9774cd3e4720174592b6d4eded7ac8fb0 Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Tue, 21 Apr 2009 13:06:04 +0000 Subject: [PATCH] Restore skips of posix and pty tests on Windows by calling the test_support.import_module on the appropriate modules before any other imports. --- Lib/test/test_posix.py | 3 ++- Lib/test/test_pty.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index a7255c41c5..32cba13e5f 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -2,6 +2,8 @@ from test import test_support +# Skip these tests if there is no posix module. +posix = test_support.import_module('posix') import time import os @@ -10,7 +12,6 @@ import shutil import unittest import warnings -posix = test_support.import_module('posix') warnings.filterwarnings('ignore', '.* potential security risk .*', RuntimeWarning) diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index 28de9effc9..ddf4807c58 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -1,10 +1,14 @@ +from test.test_support import verbose, run_unittest, import_module + +#Skip these tests if either fcntl or termios is not available +fcntl = import_module('fcntl') +import_module('termios') + import errno -import fcntl import pty import os import sys import signal -from test.test_support import verbose, run_unittest import unittest TEST_STRING_1 = "I wish to buy a fish license.\n" -- 2.50.1