diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-20 17:47:03 (GMT) |
---|---|---|
committer | Ćukasz Langa <lukasz@langa.pl> | 2017-11-20 17:47:03 (GMT) |
commit | 895862aa01793a26e74512befb0c66a1da2587d6 (patch) | |
tree | a65de848905ccd0541e15ca5584d69800e264ecf /Lib/test/test_venv.py | |
parent | c5a2071586f735d2a61d1756e7011cfbb6ce86c9 (diff) | |
download | cpython-895862aa01793a26e74512befb0c66a1da2587d6.zip cpython-895862aa01793a26e74512befb0c66a1da2587d6.tar.gz cpython-895862aa01793a26e74512befb0c66a1da2587d6.tar.bz2 |
bpo-32088: Display Deprecation in debug mode (#4474)
When Python is build is debug mode (Py_DEBUG), DeprecationWarning,
PendingDeprecationWarning and ImportWarning warnings are now
displayed by default.
test_venv: run "-m pip" and "-m ensurepip._uninstall" with -W
ignore::DeprecationWarning since pip code is not part of Python.
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r-- | Lib/test/test_venv.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index 2d76e65..c550426 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -369,7 +369,9 @@ class EnsurePipTest(BaseTest): self.fail(msg.format(exc, details)) # Ensure pip is available in the virtual environment envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe) - cmd = [envpy, '-Im', 'pip', '--version'] + # Ignore DeprecationWarning since pip code is not part of Python + cmd = [envpy, '-W', 'ignore::DeprecationWarning', '-I', + '-m', 'pip', '--version'] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() @@ -386,7 +388,8 @@ class EnsurePipTest(BaseTest): # http://bugs.python.org/issue19728 # Check the private uninstall command provided for the Windows # installers works (at least in a virtual environment) - cmd = [envpy, '-Im', 'ensurepip._uninstall'] + cmd = [envpy, '-W', 'ignore::DeprecationWarning', '-I', + '-m', 'ensurepip._uninstall'] with EnvironmentVarGuard() as envvars: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |