diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-09-22 12:37:20 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-09-22 12:37:20 -0700 |
commit | f511eaf487d59fe60271b2e4aac5fe0470fecf92 (patch) | |
tree | c57346a18721d25944d876d9903c44cafc980d5f | |
parent | 378fa86814f52fc83b5721bec6b81c5e0e4826c3 (diff) |
Strip SSH_AUTH_SOCK from test environment
-rw-r--r-- | tasks.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |