Add import_function method to test.test_support, and modify a number of
tests that expect to be skipped if imports fail or functions don't
exist to use import_function and import_module. The ultimate goal is
to change regrtest to not skip automatically on ImportError. Checking
in now to make sure the buldbots don't show any errors on platforms
I can't direct test on.
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 864f963..a7255c4 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -2,10 +2,6 @@
from test import test_support
-try:
- import posix
-except ImportError:
- raise unittest.SkipTest, "posix is not available"
import time
import os
@@ -13,6 +9,9 @@
import shutil
import unittest
import warnings
+
+posix = test_support.import_module('posix')
+
warnings.filterwarnings('ignore', '.* potential security risk .*',
RuntimeWarning)