aboutsummaryrefslogtreecommitdiff
path: root/system_tests/system_tests_sync
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2021-06-30 15:59:28 -0400
committerGitHub <noreply@github.com>2021-06-30 15:59:28 -0400
commit2079ab5e1db464f502248ae4f9e424deeef87fb2 (patch)
tree3ff3dc9b3149b8523b159e91620dcae3acc2eb90 /system_tests/system_tests_sync
parent6de903bd7d9c0011440604377aa9f1e445d50ad0 (diff)
downloadgoogle-auth-library-python-2079ab5e1db464f502248ae4f9e424deeef87fb2.tar.gz
fix: avoid leaking sub-session created for '_auth_request' (#789)
Closes #658.
Diffstat (limited to 'system_tests/system_tests_sync')
-rw-r--r--system_tests/system_tests_sync/test_requests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/system_tests/system_tests_sync/test_requests.py b/system_tests/system_tests_sync/test_requests.py
index 3ac9179..2800484 100644
--- a/system_tests/system_tests_sync/test_requests.py
+++ b/system_tests/system_tests_sync/test_requests.py
@@ -32,8 +32,10 @@ def test_authorized_session_with_service_account_and_self_signed_jwt():
# List Pub/Sub Topics through the REST API
# https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/list
- response = session.get("https://pubsub.googleapis.com/v1/projects/{}/topics".format(project_id))
- response.raise_for_status()
+ url = "https://pubsub.googleapis.com/v1/projects/{}/topics".format(project_id)
+ with session:
+ response = session.get(url)
+ response.raise_for_status()
# Check that self-signed JWT was created and is being used
assert credentials._jwt_credentials is not None