Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6fd12f2b
Kaydet (Commit)
6fd12f2b
authored
Kas 24, 2013
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 19734: better diagnostics for test_venv failures
üst
fcafe433
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
test_venv.py
Lib/test/test_venv.py
+16
-4
__init__.py
Lib/venv/__init__.py
+2
-2
No files found.
Lib/test/test_venv.py
Dosyayı görüntüle @
6fd12f2b
...
...
@@ -285,15 +285,27 @@ class EnsurePipTest(BaseTest):
# 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
)
try
:
self
.
run_with_capture
(
venv
.
create
,
self
.
env_dir
,
with_pip
=
True
)
except
subprocess
.
CalledProcessError
as
exc
:
# The output this produces can be a little hard to read, but
# least it has all the details
details
=
exc
.
output
.
decode
(
errors
=
"replace"
)
msg
=
"{}
\n\n
**Subprocess Output**
\n
{}"
.
format
(
exc
,
details
)
self
.
fail
(
msg
)
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
,
stderr
=
subprocess
.
PIPE
)
out
,
err
=
p
.
communicate
()
self
.
assertEqual
(
err
,
b
""
)
self
.
assertTrue
(
out
.
startswith
(
b
"pip"
))
self
.
assertIn
(
self
.
env_dir
.
encode
(),
out
)
# We force everything to text, so unittest gives the detailed diff
# if we get unexpected results
err
=
err
.
decode
(
"latin-1"
)
# Force to text, prevent decoding errors
self
.
assertEqual
(
err
,
""
)
out
=
out
.
decode
(
"latin-1"
)
# Force to text, prevent decoding errors
env_dir
=
os
.
fsencode
(
self
.
env_dir
)
.
decode
(
"latin-1"
)
self
.
assertTrue
(
out
.
startswith
(
"pip"
))
self
.
assertIn
(
env_dir
,
out
)
def
test_main
():
...
...
Lib/venv/__init__.py
Dosyayı görüntüle @
6fd12f2b
...
...
@@ -237,9 +237,9 @@ class EnvBuilder:
# We run ensurepip in isolated mode to avoid side effects from
# environment vars, the current directory and anything else
# intended for the global Python environment
cmd
=
[
context
.
env_exe
,
'-
I
m'
,
'ensurepip'
,
'--upgrade'
,
cmd
=
[
context
.
env_exe
,
'-m'
,
'ensurepip'
,
'--upgrade'
,
'--default-pip'
]
subprocess
.
check_output
(
cmd
)
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
def
setup_scripts
(
self
,
context
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment