@@ -30,16 +30,12 @@ def wrapper(self, *args, **kwargs):
30
30
if not client :
31
31
self .skipTest ("No client available for permission check" )
32
32
33
- try :
34
- permissions = _get_cached_permissions (client , test_client_id )
33
+ permissions = _get_cached_permissions (client , test_client_id )
35
34
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" )
38
37
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 )
43
39
44
40
return wrapper
45
41
@@ -68,19 +64,15 @@ def wrapper(self, *args, **kwargs):
68
64
if not client :
69
65
self .skipTest ("No client available for permission check" )
70
66
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 )
79
69
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
+ )
81
74
82
- except Exception as e :
83
- self .skipTest (f"Permission check failed: { str (e )} " )
75
+ return test_method (self , * args , ** kwargs )
84
76
85
77
return wrapper # type: ignore[return-value]
86
78
0 commit comments