Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4dd0f7e

Browse files
committed
Add a way to say "use any resource except A". For example, to run
allow the use of any resource except bsddb, give the option "-uall,-bsddb".
1 parent 8c8aa5d commit 4dd0f7e

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

Lib/test/regrtest.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
5959
bsddb - It is okay to run the bsddb testsuite, which takes
6060
a long time to complete.
61+
62+
To enable all resources except one, use '-uall,-<resource>'. For
63+
example, to run all the tests except for the bsddb tests, give the
64+
option '-uall,-bsddb'.
6165
"""
6266

6367
import sys
@@ -155,11 +159,18 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
155159
u = [x.lower() for x in a.split(',')]
156160
for r in u:
157161
if r == 'all':
158-
use_resources = RESOURCE_NAMES
159-
break
162+
use_resources[:] = RESOURCE_NAMES
163+
continue
164+
remove = False
165+
if r[0] == '-':
166+
remove = True
167+
r = r[1:]
160168
if r not in RESOURCE_NAMES:
161169
usage(1, 'Invalid -u/--use option: ' + a)
162-
if r not in use_resources:
170+
if remove:
171+
if r in use_resources:
172+
use_resources.remove(r)
173+
elif r not in use_resources:
163174
use_resources.append(r)
164175
if generate and verbose:
165176
usage(2, "-g and -v don't go together!")

Misc/NEWS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,9 @@ New platforms
823823
Tests
824824
-----
825825

826-
Yet to be written.
826+
- The regrtest.py script's -u option now provides a way to say "allow
827+
all resources except this one." For example, to allow everything
828+
except bsddb, give the option '-uall,-bsddb'.
827829

828830
Windows
829831
-------

0 commit comments

Comments
 (0)