]> granicus.if.org Git - python/commitdiff
Restore skips of posix and pty tests on Windows by calling the
authorR. David Murray <rdmurray@bitdance.com>
Tue, 21 Apr 2009 13:06:04 +0000 (13:06 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Tue, 21 Apr 2009 13:06:04 +0000 (13:06 +0000)
test_support.import_module on the appropriate modules
before any other imports.

Lib/test/test_posix.py
Lib/test/test_pty.py

index a7255c41c567d31ce5869698e03cc1eab5c9c5d4..32cba13e5fadfcfb900f303ac043e51dd8401296 100644 (file)
@@ -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)
index 28de9effc971c567fce5f1d8d6ca9f68eac3b02e..ddf4807c58de4c756a74f614486b05d425d7c8f1 100644 (file)
@@ -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"