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
6448b804
Kaydet (Commit)
6448b804
authored
Eyl 29, 2015
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #25220: truncate some long lines in libregrtest/*.py
üst
37554525
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
main.py
Lib/test/libregrtest/main.py
+16
-7
runtest_mp.py
Lib/test/libregrtest/runtest_mp.py
+8
-4
No files found.
Lib/test/libregrtest/main.py
Dosyayı görüntüle @
6448b804
...
@@ -63,7 +63,8 @@ def setup_python():
...
@@ -63,7 +63,8 @@ def setup_python():
# the packages to prevent later imports to fail when the CWD is different.
# the packages to prevent later imports to fail when the CWD is different.
for
module
in
sys
.
modules
.
values
():
for
module
in
sys
.
modules
.
values
():
if
hasattr
(
module
,
'__path__'
):
if
hasattr
(
module
,
'__path__'
):
module
.
__path__
=
[
os
.
path
.
abspath
(
path
)
for
path
in
module
.
__path__
]
module
.
__path__
=
[
os
.
path
.
abspath
(
path
)
for
path
in
module
.
__path__
]
if
hasattr
(
module
,
'__file__'
):
if
hasattr
(
module
,
'__file__'
):
module
.
__file__
=
os
.
path
.
abspath
(
module
.
__file__
)
module
.
__file__
=
os
.
path
.
abspath
(
module
.
__file__
)
...
@@ -159,8 +160,8 @@ class Regrtest:
...
@@ -159,8 +160,8 @@ class Regrtest:
if
self
.
ns
.
quiet
:
if
self
.
ns
.
quiet
:
return
return
fmt
=
"[{1:{0}}{2}/{3}] {4}"
if
self
.
bad
else
"[{1:{0}}{2}] {4}"
fmt
=
"[{1:{0}}{2}/{3}] {4}"
if
self
.
bad
else
"[{1:{0}}{2}] {4}"
print
(
fmt
.
format
(
print
(
fmt
.
format
(
self
.
test_count_width
,
test_index
,
self
.
test_count_width
,
test_index
,
self
.
test_count
,
len
(
self
.
bad
),
test
))
self
.
test_count
,
len
(
self
.
bad
),
test
))
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
def
setup_regrtest
(
self
):
def
setup_regrtest
(
self
):
...
@@ -252,7 +253,10 @@ class Regrtest:
...
@@ -252,7 +253,10 @@ class Regrtest:
self
.
ns
.
args
=
[]
self
.
ns
.
args
=
[]
# For a partial run, we do not need to clutter the output.
# For a partial run, we do not need to clutter the output.
if
self
.
ns
.
verbose
or
self
.
ns
.
header
or
not
(
self
.
ns
.
quiet
or
self
.
ns
.
single
or
self
.
tests
or
self
.
ns
.
args
):
if
(
self
.
ns
.
verbose
or
self
.
ns
.
header
or
not
(
self
.
ns
.
quiet
or
self
.
ns
.
single
or
self
.
tests
or
self
.
ns
.
args
)):
# Print basic platform information
# Print basic platform information
print
(
"=="
,
platform
.
python_implementation
(),
*
sys
.
version
.
split
())
print
(
"=="
,
platform
.
python_implementation
(),
*
sys
.
version
.
split
())
print
(
"== "
,
platform
.
platform
(
aliased
=
True
),
print
(
"== "
,
platform
.
platform
(
aliased
=
True
),
...
@@ -283,7 +287,8 @@ class Regrtest:
...
@@ -283,7 +287,8 @@ class Regrtest:
try
:
try
:
del
self
.
selected
[:
self
.
selected
.
index
(
self
.
ns
.
start
)]
del
self
.
selected
[:
self
.
selected
.
index
(
self
.
ns
.
start
)]
except
ValueError
:
except
ValueError
:
print
(
"Couldn't find starting test (
%
s), using all tests"
%
self
.
ns
.
start
)
print
(
"Couldn't find starting test (
%
s), using all tests"
%
self
.
ns
.
start
)
if
self
.
ns
.
randomize
:
if
self
.
ns
.
randomize
:
if
self
.
ns
.
random_seed
is
None
:
if
self
.
ns
.
random_seed
is
None
:
...
@@ -297,12 +302,16 @@ class Regrtest:
...
@@ -297,12 +302,16 @@ class Regrtest:
# print a newline after ^C
# print a newline after ^C
print
()
print
()
print
(
"Test suite interrupted by signal SIGINT."
)
print
(
"Test suite interrupted by signal SIGINT."
)
omitted
=
set
(
self
.
selected
)
-
set
(
self
.
good
)
-
set
(
self
.
bad
)
-
set
(
self
.
skipped
)
executed
=
set
(
self
.
good
)
|
set
(
self
.
bad
)
|
set
(
self
.
skipped
)
omitted
=
set
(
self
.
selected
)
-
executed
print
(
count
(
len
(
omitted
),
"test"
),
"omitted:"
)
print
(
count
(
len
(
omitted
),
"test"
),
"omitted:"
)
printlist
(
omitted
)
printlist
(
omitted
)
if
self
.
good
and
not
self
.
ns
.
quiet
:
if
self
.
good
and
not
self
.
ns
.
quiet
:
if
not
self
.
bad
and
not
self
.
skipped
and
not
self
.
interrupted
and
len
(
self
.
good
)
>
1
:
if
(
not
self
.
bad
and
not
self
.
skipped
and
not
self
.
interrupted
and
len
(
self
.
good
)
>
1
):
print
(
"All"
,
end
=
' '
)
print
(
"All"
,
end
=
' '
)
print
(
count
(
len
(
self
.
good
),
"test"
),
"OK."
)
print
(
count
(
len
(
self
.
good
),
"test"
),
"OK."
)
...
...
Lib/test/libregrtest/runtest_mp.py
Dosyayı görüntüle @
6448b804
...
@@ -103,20 +103,23 @@ class MultiprocessThread(threading.Thread):
...
@@ -103,20 +103,23 @@ class MultiprocessThread(threading.Thread):
except
StopIteration
:
except
StopIteration
:
self
.
output
.
put
((
None
,
None
,
None
,
None
))
self
.
output
.
put
((
None
,
None
,
None
,
None
))
return
return
retcode
,
stdout
,
stderr
=
run_tests_in_subprocess
(
test
,
self
.
ns
)
retcode
,
stdout
,
stderr
=
run_tests_in_subprocess
(
test
,
self
.
ns
)
# Strip last refcount output line if it exists, since it
# Strip last refcount output line if it exists, since it
# comes from the shutdown of the interpreter in the subcommand.
# comes from the shutdown of the interpreter in the subcommand.
stderr
=
debug_output_pat
.
sub
(
""
,
stderr
)
stderr
=
debug_output_pat
.
sub
(
""
,
stderr
)
stdout
,
_
,
result
=
stdout
.
strip
()
.
rpartition
(
"
\n
"
)
stdout
,
_
,
result
=
stdout
.
strip
()
.
rpartition
(
"
\n
"
)
if
retcode
!=
0
:
if
retcode
!=
0
:
result
=
(
CHILD_ERROR
,
"Exit code
%
s"
%
retcode
)
result
=
(
CHILD_ERROR
,
"Exit code
%
s"
%
retcode
)
self
.
output
.
put
((
test
,
stdout
.
rstrip
(),
stderr
.
rstrip
(),
result
))
self
.
output
.
put
((
test
,
stdout
.
rstrip
(),
stderr
.
rstrip
(),
result
))
return
return
if
not
result
:
if
not
result
:
self
.
output
.
put
((
None
,
None
,
None
,
None
))
self
.
output
.
put
((
None
,
None
,
None
,
None
))
return
return
result
=
json
.
loads
(
result
)
result
=
json
.
loads
(
result
)
self
.
output
.
put
((
test
,
stdout
.
rstrip
(),
stderr
.
rstrip
(),
result
))
self
.
output
.
put
((
test
,
stdout
.
rstrip
(),
stderr
.
rstrip
(),
result
))
except
BaseException
:
except
BaseException
:
self
.
output
.
put
((
None
,
None
,
None
,
None
))
self
.
output
.
put
((
None
,
None
,
None
,
None
))
raise
raise
...
@@ -149,7 +152,8 @@ def run_tests_multiprocess(regrtest):
...
@@ -149,7 +152,8 @@ def run_tests_multiprocess(regrtest):
if
result
[
0
]
==
INTERRUPTED
:
if
result
[
0
]
==
INTERRUPTED
:
raise
KeyboardInterrupt
raise
KeyboardInterrupt
if
result
[
0
]
==
CHILD_ERROR
:
if
result
[
0
]
==
CHILD_ERROR
:
raise
Exception
(
"Child error on {}: {}"
.
format
(
test
,
result
[
1
]))
msg
=
"Child error on {}: {}"
.
format
(
test
,
result
[
1
])
raise
Exception
(
msg
)
test_index
+=
1
test_index
+=
1
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
regrtest
.
interrupted
=
True
regrtest
.
interrupted
=
True
...
...
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