Skip to content

Commit 4537a78

Browse files
committed
check error string
1 parent 35627dd commit 4537a78

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

system_tests/system_tests_async/test_default.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
@pytest.mark.asyncio
2626
async def test_application_default_credentials(verify_refresh):
2727
credentials, project_id = _default_async.default_async()
28-
breakpoint()
2928

3029
if EXPECT_PROJECT_ID is not None:
3130
assert project_id is not None
3231

3332
try:
3433
await verify_refresh(credentials)
35-
except RefreshError:
36-
# allow expired credentials for explicit user tests
37-
if not CREDENTIALS.endswith("authorized_user.json"):
34+
except RefreshError as e:
35+
# allow expired credentials for explicit_authorized_user tests
36+
# 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):
3838
raise

system_tests/system_tests_sync/test_default.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def test_application_default_credentials(verify_refresh):
2929

3030
try:
3131
verify_refresh(credentials)
32-
except RefreshError:
32+
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"):
35+
if not CREDENTIALS.endswith("authorized_user.json") or "Token has been expired or revoked" not in str(e):
3636
raise

0 commit comments

Comments
 (0)