[tor-commits] [stem/master] AttributeError exception for catching non existing methods

atagar at torproject.org atagar at torproject.org
Sun Mar 8 00:38:49 UTC 2015


commit b0236abe4c003a1bc5b72419bba2761e126068f4
Author: Cristóbal <cristobal.leiva at usach.cl>
Date:   Fri Mar 6 19:06:14 2015 -0300

    AttributeError exception for catching non existing methods
---
 run_tests.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/run_tests.py b/run_tests.py
index 497a3fc..876b296 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -465,10 +465,13 @@ def _run_test(args, test_class, output_filters, logging_buffer):
 
   try:
     suite = unittest.TestLoader().loadTestsFromName(test_class)
-  except:
+  except AttributeError, e:
     # should only come up if user provided '--test' for something that doesn't exist
     println(" no such test", ERROR)
     return None
+  except:
+    println(" failed", ERROR)
+    return None
 
   test_results = StringIO()
   run_result = unittest.TextTestRunner(test_results, verbosity=2).run(suite)



More information about the tor-commits mailing list