From: Xiang Zhang Date: Mon, 19 Dec 2016 13:01:33 +0000 (+0800) Subject: Issue #28950: Disallow -j0 combined with -T/-l/-M in regrtest. X-Git-Tag: v3.5.3rc1~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=270a21fda0c41ea120727140ac966a86f694eee4;p=python Issue #28950: Disallow -j0 combined with -T/-l/-M in regrtest. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 6b7ce16c68..c1d85f6a18 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -380,11 +380,11 @@ def _parse_args(args, **kwargs): if ns.single and ns.fromfile: parser.error("-s and -f don't go together!") - if ns.use_mp and ns.trace: + if ns.use_mp is not None and ns.trace: parser.error("-T and -j don't go together!") - if ns.use_mp and ns.findleaks: + if ns.use_mp is not None and ns.findleaks: parser.error("-l and -j don't go together!") - if ns.use_mp and ns.memlimit: + if ns.use_mp is not None and ns.memlimit: parser.error("-M and -j don't go together!") if ns.failfast and not (ns.verbose or ns.verbose3): parser.error("-G/--failfast needs either -v or -W") diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index ae183272a1..e2c2f2da86 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -200,6 +200,9 @@ class ParseArgsTestCase(unittest.TestCase): self.checkError([opt, '2', '-T'], "don't go together") self.checkError([opt, '2', '-l'], "don't go together") self.checkError([opt, '2', '-M', '4G'], "don't go together") + self.checkError([opt, '0', '-T'], "don't go together") + self.checkError([opt, '0', '-l'], "don't go together") + self.checkError([opt, '0', '-M', '4G'], "don't go together") def test_coverage(self): for opt in '-T', '--coverage': diff --git a/Misc/NEWS b/Misc/NEWS index a2c2881f76..33b777b0f2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -549,6 +549,9 @@ Documentation Tests ----- +- Issue #28950: Disallow -j0 to be combined with -T/-l/-M in regrtest + command line arguments. + - Issue #28666: Now test.support.rmtree is able to remove unwritable or unreadable directories.