mirror of
https://github.com/python/cpython.git
synced 2025-10-14 10:53:40 +00:00
Two small changes to the resource usage option:
(1) Allow multiple -u options to extend each other (and the initial value of use_resources passed into regrtest.main()). (2) When a test is run stand-alone (not via regrtest.py), needed resources are always granted.
This commit is contained in:
parent
6091cd61ce
commit
fe3f6969f5
2 changed files with 5 additions and 4 deletions
|
@ -20,7 +20,7 @@ class TestSkipped(Error):
|
|||
"""
|
||||
|
||||
verbose = 1 # Flag set to 0 by regrtest.py
|
||||
use_resources = [] # Flag set to [] by regrtest.py
|
||||
use_resources = None # Flag set to [] by regrtest.py
|
||||
|
||||
def unload(name):
|
||||
try:
|
||||
|
@ -38,7 +38,7 @@ def forget(modname):
|
|||
pass
|
||||
|
||||
def requires(resource, msg=None):
|
||||
if resource not in use_resources:
|
||||
if use_resources is not None and resource not in use_resources:
|
||||
if msg is None:
|
||||
msg = "Use of the `%s' resource not enabled" % resource
|
||||
raise TestSkipped(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue