summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 8169533..8ac3851 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -21,6 +21,14 @@ class TestSkipped(Error):
TestFailed.
"""
+class ResourceDenied(TestSkipped):
+ """Test skipped because it requested a disallowed resource.
+
+ This is raised when a test calls requires() for a resource that
+ has not be enabled. It is used to distinguish between expected
+ and unexpected skips.
+ """
+
verbose = 1 # Flag set to 0 by regrtest.py
use_resources = None # Flag set to [] by regrtest.py
@@ -57,7 +65,7 @@ def requires(resource, msg=None):
if not is_resource_enabled(resource):
if msg is None:
msg = "Use of the `%s' resource not enabled" % resource
- raise TestSkipped(msg)
+ raise ResourceDenied(msg)
FUZZ = 1e-6