File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -34,5 +34,12 @@ async def test_application_default_credentials(verify_refresh):
3434 except RefreshError as e :
3535 # allow expired credentials for explicit_authorized_user tests
3636 # TODO: https://github.com/googleapis/google-auth-library-python/issues/1882
37- if not CREDENTIALS .endswith ("authorized_user.json" ) or "Token has been expired or revoked" not in str (e ):
37+ if not CREDENTIALS .endswith ("authorized_user.json" ):
38+ raise
39+
40+ error_message = str (e )
41+ if (
42+ "Token has been expired or revoked" not in error_message
43+ and "invalid_grant" not in error_message
44+ ):
3845 raise
Original file line number Diff line number Diff line change @@ -32,5 +32,12 @@ def test_application_default_credentials(verify_refresh):
3232 except RefreshError as e :
3333 # allow expired credentials for explicit_authorized_user tests
3434 # TODO: https://github.com/googleapis/google-auth-library-python/issues/1882
35- if not CREDENTIALS .endswith ("authorized_user.json" ) or "Token has been expired or revoked" not in str (e ):
35+ if not CREDENTIALS .endswith ("authorized_user.json" ):
36+ raise
37+
38+ error_message = str (e )
39+ if (
40+ "Token has been expired or revoked" not in error_message
41+ and "invalid_grant" not in error_message
42+ ):
3643 raise
You can’t perform that action at this time.
0 commit comments