@@ -30,16 +30,12 @@ def wrapper(self, *args, **kwargs):
3030 if not client :
3131 self .skipTest ("No client available for permission check" )
3232
33- try :
34- permissions = _get_cached_permissions (client , test_client_id )
33+ permissions = _get_cached_permissions (client , test_client_id )
3534
36- if not any (role .value == app_role for role in permissions ):
37- self .skipTest (f"Required app permission '{ app_role } ' not granted" )
35+ if not any (role .value == app_role for role in permissions ):
36+ self .skipTest (f"Required app permission '{ app_role } ' not granted" )
3837
39- return test_method (self , * args , ** kwargs )
40-
41- except Exception as e :
42- self .skipTest (f"Permission check failed: { str (e )} " )
38+ return test_method (self , * args , ** kwargs )
4339
4440 return wrapper
4541
@@ -68,19 +64,15 @@ def wrapper(self, *args, **kwargs):
6864 if not client :
6965 self .skipTest ("No client available for permission check" )
7066
71- try :
72- # Get permissions from cache or API
73- granted_scopes = _get_cached_delegated_permissions (client , test_client_id )
74-
75- if not any (scope in granted_scopes for scope in scopes ):
76- self .skipTest (
77- f"Required delegated permission '{ ', ' .join (scopes )} ' not granted"
78- )
67+ # Get permissions from cache or API
68+ granted_scopes = _get_cached_delegated_permissions (client , test_client_id )
7969
80- return test_method (self , * args , ** kwargs )
70+ if not any (scope in granted_scopes for scope in scopes ):
71+ self .skipTest (
72+ f"Required delegated permission '{ ', ' .join (scopes )} ' not granted"
73+ )
8174
82- except Exception as e :
83- self .skipTest (f"Permission check failed: { str (e )} " )
75+ return test_method (self , * args , ** kwargs )
8476
8577 return wrapper # type: ignore[return-value]
8678
0 commit comments