[PATCH 6 of 9] tests: small refactoring of run-tests' handling of tests list

Mads Kiilerich mads at kiilerich.com
Tue Mar 18 18:33:54 CDT 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1395184794 -3600
#      Wed Mar 19 00:19:54 2014 +0100
# Node ID 4546fe5f1b924ca58ac18a14253ebdc31c9af9bd
# Parent  41894a7fe54a8b98d45b782ef49245486f24c0dc
tests: small refactoring of run-tests' handling of tests list

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1180,12 +1180,12 @@ def main():
 
     checktools()
 
-    if len(args) == 0:
-        args = [t for t in os.listdir(".")
-                if t.startswith("test-")
-                and (t.endswith(".py") or t.endswith(".t"))]
+    if not args:
+        args = os.listdir(".")
 
-    tests = args
+    tests = [t for t in args
+             if t.startswith("test-")
+             and (t.endswith(".py") or t.endswith(".t"))]
 
     if options.random:
         random.shuffle(tests)


More information about the Mercurial-devel mailing list