summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-11-23 01:37:28 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-11-23 01:37:28 (GMT)
commitd76cdc161e2e9523c51af63e8f7cfd310ef1a74b (patch)
tree2e4e02d993a2fe27ce44e26b0869d6bb782262db /Lib/test/test_venv.py
parentfd66cc5534ffb8fbdd071b2c453744562a16e818 (diff)
downloadcpython-d76cdc161e2e9523c51af63e8f7cfd310ef1a74b.zip
cpython-d76cdc161e2e9523c51af63e8f7cfd310ef1a74b.tar.gz
cpython-d76cdc161e2e9523c51af63e8f7cfd310ef1a74b.tar.bz2
Close #19694: venv now runs ensurepip in isolated mode
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 6047f87..87d727e 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -12,7 +12,7 @@ import subprocess
import sys
import tempfile
from test.support import (captured_stdout, captured_stderr, run_unittest,
- can_symlink)
+ can_symlink, EnvironmentVarGuard)
import unittest
import venv
@@ -280,7 +280,12 @@ class EnsurePipTest(BaseTest):
def test_with_pip(self):
shutil.rmtree(self.env_dir)
- self.run_with_capture(venv.create, self.env_dir, with_pip=True)
+ with EnvironmentVarGuard() as envvars:
+ # pip's cross-version compatibility may trigger deprecation
+ # warnings in current versions of Python. Ensure related
+ # environment settings don't cause venv to fail.
+ envvars["PYTHONWARNINGS"] = "e"
+ self.run_with_capture(venv.create, self.env_dir, with_pip=True)
envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe)
cmd = [envpy, '-m', 'pip', '--version']
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,