# HG changeset patch # User Martin von Zweigbergk # Date 2019-01-09 06:07:47 # Node ID 89d103fc9c196964fe4b623206ba5b3a0f086977 # Parent 92a5fb73b3d583fbe29768777093bd44cd926794 testrunner: avoid capturing a regex group we don't care about Differential Revision: https://phab.mercurial-scm.org/D5536 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -2786,7 +2786,8 @@ class TestRunner(object): expanded_args.append(arg) args = expanded_args - testcasepattern = re.compile(br'([\w-]+\.t|py)(#([a-zA-Z0-9_\-\.#]+))') + testcasepattern = re.compile( + br'([\w-]+\.t|py)(?:#([a-zA-Z0-9_\-\.#]+))') tests = [] for t in args: case = [] @@ -2796,7 +2797,7 @@ class TestRunner(object): m = testcasepattern.match(os.path.basename(t)) if m is not None: - t_basename, _, casestr = m.groups() + t_basename, casestr = m.groups() t = os.path.join(os.path.dirname(t), t_basename) if casestr: case = casestr.split(b'#')