From fdd7e67a1ffe051b3e5634499a1af9389a83570b 2014-02-25 18:08:58 From: Thomas Kluyver Date: 2014-02-25 18:08:58 Subject: [PATCH] Unset PYTHONWARNINGS envvar before running subprocess tests. The extra warnings in the subprocesses were causing test failures. Closes gh-5218 --- diff --git a/IPython/testing/tools.py b/IPython/testing/tools.py index c9772de..5989843 100644 --- a/IPython/testing/tools.py +++ b/IPython/testing/tools.py @@ -213,7 +213,9 @@ def ipexec(fname, options=None): # Absolute path for filename full_fname = os.path.join(test_dir, fname) full_cmd = ipython_cmd + cmdargs + [full_fname] - p = Popen(full_cmd, stdout=PIPE, stderr=PIPE) + env = os.environ.copy() + env.pop('PYTHONWARNINGS') # Avoid extraneous warnings appearing on stderr + p = Popen(full_cmd, stdout=PIPE, stderr=PIPE, env=env) out, err = p.communicate() out, err = py3compat.bytes_to_str(out), py3compat.bytes_to_str(err) # `import readline` causes 'ESC[?1034h' to be output sometimes,