diff options
| author | Benjamin Peterson <benjamin@python.org> | 2009-03-26 20:48:25 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2009-03-26 20:48:25 (GMT) |
| commit | 888a39b54c4f47ee25d53b157e2c50402627cd0b (patch) | |
| tree | 67a48f107d83b8451e338f1ea822f2b4c65f6960 /Lib/test/test_support.py | |
| parent | 21f6aac633a78271e762d6cd4b709e6a91d0c42a (diff) | |
| download | cpython-888a39b54c4f47ee25d53b157e2c50402627cd0b.zip cpython-888a39b54c4f47ee25d53b157e2c50402627cd0b.tar.gz cpython-888a39b54c4f47ee25d53b157e2c50402627cd0b.tar.bz2 | |
remove test_support.TestSkipped and just use unittest.SkipTest
Diffstat (limited to 'Lib/test/test_support.py')
| -rw-r--r-- | Lib/test/test_support.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 9398465..0e289c1 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -13,7 +13,7 @@ import shutil import warnings import unittest -__all__ = ["Error", "TestFailed", "TestSkipped", "ResourceDenied", "import_module", +__all__ = ["Error", "TestFailed", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", "get_original_stdout", "unload", "unlink", "rmtree", "forget", "is_resource_enabled", "requires", "find_unused_port", "bind_port", @@ -33,17 +33,7 @@ class Error(Exception): class TestFailed(Error): """Test failed.""" -class TestSkipped(Error): - """Test skipped. - - This can be raised to indicate that a test was deliberatly - skipped, but not because a feature wasn't available. For - example, if some resource can't be used, such as the network - appears to be unavailable, this should be raised instead of - TestFailed. - """ - -class ResourceDenied(TestSkipped): +class ResourceDenied(SkipTest): """Test skipped because it requested a disallowed resource. This is raised when a test calls requires() for a resource that @@ -52,7 +42,7 @@ class ResourceDenied(TestSkipped): """ def import_module(name, deprecated=False): - """Import the module to be tested, raising TestSkipped if it is not + """Import the module to be tested, raising SkipTest if it is not available.""" with warnings.catch_warnings(): if deprecated: @@ -61,7 +51,7 @@ def import_module(name, deprecated=False): try: module = __import__(name, level=0) except ImportError: - raise TestSkipped("No module named " + name) + raise SkipTest("No module named " + name) else: return module |
