summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-09-22 12:37:20 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-09-22 12:37:20 -0700
commitf511eaf487d59fe60271b2e4aac5fe0470fecf92 (patch)
treec57346a18721d25944d876d9903c44cafc980d5f
parent378fa86814f52fc83b5721bec6b81c5e0e4826c3 (diff)
Strip SSH_AUTH_SOCK from test environment
-rw-r--r--tasks.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tasks.py b/tasks.py
index a34fd3ce..4ddeeee3 100644
--- a/tasks.py
+++ b/tasks.py
@@ -1,3 +1,4 @@
+import os
from os.path import join
from shutil import rmtree, copytree
@@ -15,7 +16,13 @@ def test(ctx, coverage=False, flags=""):
runner = "python"
if coverage:
runner = "coverage run --source=paramiko"
- ctx.run("{0} test.py {1}".format(runner, flags), pty=True)
+ # Strip SSH_AUTH_SOCK from parent env to avoid pollution by interactive
+ # users.
+ env = dict(os.environ)
+ if 'SSH_AUTH_SOCK' in env:
+ del env['SSH_AUTH_SOCK']
+ cmd = "{0} test.py {1}".format(runner, flags)
+ ctx.run(cmd, pty=True, env=env, replace_env=True)
@task