diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-05-09 22:51:58 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-05-09 22:51:58 (GMT) |
commit | 9ac3974de847a3d94a49b70ee7c6a70eaa43bbf6 (patch) | |
tree | 4fe731ef2a4c53a2f2fc49fbbd9f37089705d00c /Lib | |
parent | 1aed624f7c6051bc670a846825bd40108d3f8dd5 (diff) | |
download | cpython-9ac3974de847a3d94a49b70ee7c6a70eaa43bbf6.zip cpython-9ac3974de847a3d94a49b70ee7c6a70eaa43bbf6.tar.gz cpython-9ac3974de847a3d94a49b70ee7c6a70eaa43bbf6.tar.bz2 |
Deprecate the pure module for 3.0.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_py3kwarn.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index c66ff73..48cd4e7 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -129,8 +129,9 @@ class TestStdlibRemovals(unittest.TestCase): # test.testall not tested as it executes all unit tests as an # import side-effect. all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new') + inclusive_platforms = {'irix':('pure',)} - def check_removal(self, module_name): + def check_removal(self, module_name, optional=False): """Make sure the specified module, when imported, raises a DeprecationWarning and specifies itself in the message.""" original_module = None @@ -145,6 +146,9 @@ class TestStdlibRemovals(unittest.TestCase): __import__(module_name, level=0) except DeprecationWarning as exc: self.assert_(module_name in exc.args[0]) + except ImportError: + if not optional: + raise else: self.fail("DeprecationWarning not raised for %s" % module_name) @@ -159,6 +163,11 @@ class TestStdlibRemovals(unittest.TestCase): for module_name in self.all_platforms: self.check_removal(module_name) + def test_platform_specific_removals(self): + # Test the removal of platform-specific modules. + for module_name in self.inclusive_platforms.get(sys.platform, []): + 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 |