Skip to content

Commit b2873e2

Browse files
committed
set env var back after test run
1 parent e143356 commit b2873e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

system_tests/noxfile.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,20 @@ def compute_engine(session):
273273
# credentials are detected from environment
274274
is_present = "GOOGLE_APPLICATION_CREDENTIALS" in session.virtualenv.env
275275
print(f"GOOGLE_APPLICATION_CREDENTIALS is present: {is_present}")
276-
del session.virtualenv.env["GOOGLE_APPLICATION_CREDENTIALS"]
276+
if is_present:
277+
env_var = session.virtualenv.env["GOOGLE_APPLICATION_CREDENTIALS"]
278+
del session.virtualenv.env["GOOGLE_APPLICATION_CREDENTIALS"]
277279
session.install(LIBRARY_DIR)
278280
default(
279281
session,
280282
"system_tests_sync/test_compute_engine.py",
281283
*session.posargs,
282284
)
283285

286+
session.virtualenv.env["GOOGLE_APPLICATION_CREDENTIALS"] = env_var
287+
288+
289+
284290

285291
@nox.session(python=PYTHON_VERSIONS_SYNC)
286292
def grpc(session):

0 commit comments

Comments
 (0)