summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_bsddb185.py4
-rw-r--r--Lib/test/test_py3kwarn.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_bsddb185.py b/Lib/test/test_bsddb185.py
index 51e1a7eb8d..98102c1457 100644
--- a/Lib/test/test_bsddb185.py
+++ b/Lib/test/test_bsddb185.py
@@ -4,9 +4,9 @@ The file 185test.db found in Lib/test/ is for testing purposes with this
testing suite.
"""
-from test.test_support import run_unittest, findfile
+from test.test_support import run_unittest, findfile, import_module
import unittest
-import bsddb185
+bsddb185 = import_module('bsddb185', deprecated=True)
import anydbm
import whichdb
import os
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 22257e1d1e..ae5713476e 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -131,6 +131,7 @@ class TestStdlibRemovals(unittest.TestCase):
all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
'Bastion')
inclusive_platforms = {'irix':('pure',)}
+ optional_modules = ('bsddb185',)
def check_removal(self, module_name, optional=False):
"""Make sure the specified module, when imported, raises a
@@ -169,6 +170,11 @@ class TestStdlibRemovals(unittest.TestCase):
for module_name in self.inclusive_platforms.get(sys.platform, []):
self.check_removal(module_name, optional=True)
+ def test_optional_module_removals(self):
+ # Test the removal of modules that may or may not be built.
+ for module_name in self.optional_modules:
+ self.check_removal(module_name, optional=True)
+
def test_os_path_walk(self):
msg = "In 3.x, os.path.walk is removed in favor of os.walk."
def dumbo(where, names, args): pass