[Lldb-commits] [lldb] r250038 - dotest.py: Remove useless AttributeError catches

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 12 06:42:16 PDT 2015


Author: labath
Date: Mon Oct 12 08:42:16 2015
New Revision: 250038

URL: http://llvm.org/viewvc/llvm-project?rev=250038&view=rev
Log:
dotest.py: Remove useless AttributeError catches

Summary:
Test decorators were ignoring AttributeError exceptions. These were introduced three years ago,
and copied to all decorators. They seem to serve no purpose and removing them produces no errors.
Given that they have prevented us from noticing the problem in r249819, I am removing them.

Reviewers: zturner, tfiala

Subscribers: iancottrell, lldb-commits

Differential Revision: http://reviews.llvm.org/D13583

Modified:
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=250038&r1=250037&r2=250038&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Mon Oct 12 08:42:16 2015
@@ -475,11 +475,8 @@ def python_api_test(func):
         raise Exception("@python_api_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_python_api_test:
-                self.skipTest("python api tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_python_api_test:
+            self.skipTest("python api tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from lldb command line tests.
@@ -492,11 +489,8 @@ def lldbmi_test(func):
         raise Exception("@lldbmi_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_lldbmi_test:
-                self.skipTest("lldb-mi tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_lldbmi_test:
+            self.skipTest("lldb-mi tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from lldb command line tests.
@@ -509,11 +503,8 @@ def benchmarks_test(func):
         raise Exception("@benchmarks_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if not lldb.just_do_benchmarks_test:
-                self.skipTest("benchmarks tests")
-        except AttributeError:
-            pass
+        if not lldb.just_do_benchmarks_test:
+            self.skipTest("benchmarks tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.
@@ -539,11 +530,8 @@ def dsym_test(func):
         raise Exception("@dsym_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_dsym_test:
-                self.skipTest("dsym tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_dsym_test:
+            self.skipTest("dsym tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.
@@ -556,11 +544,8 @@ def dwarf_test(func):
         raise Exception("@dwarf_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_dwarf_test:
-                self.skipTest("dwarf tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_dwarf_test:
+            self.skipTest("dwarf tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.
@@ -573,11 +558,8 @@ def dwo_test(func):
         raise Exception("@dwo_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_dwo_test:
-                self.skipTest("dwo tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_dwo_test:
+            self.skipTest("dwo tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.
@@ -590,11 +572,8 @@ def debugserver_test(func):
         raise Exception("@debugserver_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_debugserver_test:
-                self.skipTest("debugserver tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_debugserver_test:
+            self.skipTest("debugserver tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.
@@ -607,11 +586,8 @@ def llgs_test(func):
         raise Exception("@llgs_test can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.dont_do_llgs_test:
-                self.skipTest("llgs tests")
-        except AttributeError:
-            pass
+        if lldb.dont_do_llgs_test:
+            self.skipTest("llgs tests")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.
@@ -624,11 +600,8 @@ def not_remote_testsuite_ready(func):
         raise Exception("@not_remote_testsuite_ready can only be used to decorate a test method")
     @wraps(func)
     def wrapper(self, *args, **kwargs):
-        try:
-            if lldb.lldbtest_remote_sandbox or lldb.remote_platform:
-                self.skipTest("not ready for remote testsuite")
-        except AttributeError:
-            pass
+        if lldb.lldbtest_remote_sandbox or lldb.remote_platform:
+            self.skipTest("not ready for remote testsuite")
         return func(self, *args, **kwargs)
 
     # Mark this function as such to separate them from the regular tests.




More information about the lldb-commits mailing list