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
38c8b7d2
Kaydet (Commit)
38c8b7d2
authored
Kas 14, 2016
tarafından
Xavier de Gaye
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28662: Catch PermissionError in tests when spawning a non existent program
üst
8bf43e6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
test_dtrace.py
Lib/test/test_dtrace.py
+1
-1
test_shutil.py
Lib/test/test_shutil.py
+2
-1
test_subprocess.py
Lib/test/test_subprocess.py
+3
-2
No files found.
Lib/test/test_dtrace.py
Dosyayı görüntüle @
38c8b7d2
...
@@ -79,7 +79,7 @@ class TraceBackend:
...
@@ -79,7 +79,7 @@ class TraceBackend:
try
:
try
:
output
=
self
.
trace
(
abspath
(
"assert_usable"
+
self
.
EXTENSION
))
output
=
self
.
trace
(
abspath
(
"assert_usable"
+
self
.
EXTENSION
))
output
=
output
.
strip
()
output
=
output
.
strip
()
except
FileNotFoundError
as
fnfe
:
except
(
FileNotFoundError
,
PermissionError
)
as
fnfe
:
output
=
str
(
fnfe
)
output
=
str
(
fnfe
)
if
output
!=
"probe: success"
:
if
output
!=
"probe: success"
:
raise
unittest
.
SkipTest
(
raise
unittest
.
SkipTest
(
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
38c8b7d2
...
@@ -1869,7 +1869,8 @@ class TermsizeTests(unittest.TestCase):
...
@@ -1869,7 +1869,8 @@ class TermsizeTests(unittest.TestCase):
"""
"""
try
:
try
:
size
=
subprocess
.
check_output
([
'stty'
,
'size'
])
.
decode
()
.
split
()
size
=
subprocess
.
check_output
([
'stty'
,
'size'
])
.
decode
()
.
split
()
except
(
FileNotFoundError
,
subprocess
.
CalledProcessError
):
except
(
FileNotFoundError
,
PermissionError
,
subprocess
.
CalledProcessError
):
self
.
skipTest
(
"stty invocation failed"
)
self
.
skipTest
(
"stty invocation failed"
)
expected
=
(
int
(
size
[
1
]),
int
(
size
[
0
]))
# reversed order
expected
=
(
int
(
size
[
1
]),
int
(
size
[
0
]))
# reversed order
...
...
Lib/test/test_subprocess.py
Dosyayı görüntüle @
38c8b7d2
...
@@ -293,7 +293,8 @@ class ProcessTestCase(BaseTestCase):
...
@@ -293,7 +293,8 @@ class ProcessTestCase(BaseTestCase):
# Verify first that the call succeeds without the executable arg.
# Verify first that the call succeeds without the executable arg.
pre_args
=
[
sys
.
executable
,
"-c"
]
pre_args
=
[
sys
.
executable
,
"-c"
]
self
.
_assert_python
(
pre_args
)
self
.
_assert_python
(
pre_args
)
self
.
assertRaises
(
FileNotFoundError
,
self
.
_assert_python
,
pre_args
,
self
.
assertRaises
((
FileNotFoundError
,
PermissionError
),
self
.
_assert_python
,
pre_args
,
executable
=
"doesnotexist"
)
executable
=
"doesnotexist"
)
@unittest.skipIf
(
mswindows
,
"executable argument replaces shell"
)
@unittest.skipIf
(
mswindows
,
"executable argument replaces shell"
)
...
@@ -2753,7 +2754,7 @@ class ContextManagerTests(BaseTestCase):
...
@@ -2753,7 +2754,7 @@ class ContextManagerTests(BaseTestCase):
self
.
assertEqual
(
proc
.
returncode
,
1
)
self
.
assertEqual
(
proc
.
returncode
,
1
)
def
test_invalid_args
(
self
):
def
test_invalid_args
(
self
):
with
self
.
assertRaises
(
FileNotFoundError
)
as
c
:
with
self
.
assertRaises
(
(
FileNotFoundError
,
PermissionError
)
)
as
c
:
with
subprocess
.
Popen
([
'nonexisting_i_hope'
],
with
subprocess
.
Popen
([
'nonexisting_i_hope'
],
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
as
proc
:
stderr
=
subprocess
.
PIPE
)
as
proc
:
...
...
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