[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [chutney/master] TorNet: replace for loop with list comprehension



commit bc7abead8e2be29bc89d485cb86c01b92c5165b1
Author: c <c@xxxxxxxxxxx>
Date:   Sun Jul 5 08:09:31 2020 +0000

    TorNet: replace for loop with list comprehension
    
    seems easier to read
---
 lib/chutney/TorNet.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index b19c2f2..f31b254 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -2540,13 +2540,11 @@ def ConfigureNodes(nodelist):
             network._dfltEnv['hasbridgeauth'] = True
 
 def getTests():
-    tests = []
     chutney_path = get_absolute_chutney_path()
     chutney_tests_path = chutney_path / "scripts" / "chutney_tests"
-    for x in chutney_tests_path.glob("*.py"):
-        if not x.startswith("_"):
-            tests.append(x.with_suffix(""))
-    return tests
+
+    return [test.name for test in chutney_tests_path.glob("*.py")
+            if not test.name.startswith("_")]
 
 
 def usage(network):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits