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
436831db
Kaydet (Commit)
436831db
authored
Ock 13, 2016
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue22642 - Convert trace module's option handling mechanism from getopt to argparse.
Patch contributed by SilentGhost.
üst
121edbf7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
test_trace.py
Lib/test/test_trace.py
+22
-0
trace.py
Lib/trace.py
+0
-0
No files found.
Lib/test/test_trace.py
Dosyayı görüntüle @
436831db
import
os
import
sys
from
test.support
import
TESTFN
,
rmtree
,
unlink
,
captured_stdout
from
test.support.script_helper
import
assert_python_ok
,
assert_python_failure
import
unittest
import
trace
...
...
@@ -364,6 +365,27 @@ class Test_Ignore(unittest.TestCase):
# Matched before.
self
.
assertTrue
(
ignore
.
names
(
jn
(
'bar'
,
'baz.py'
),
'baz'
))
class
TestCommandLine
(
unittest
.
TestCase
):
def
test_failures
(
self
):
_errors
=
(
(
b
'filename is missing: required with the main options'
,
'-l'
,
'-T'
),
(
b
'cannot specify both --listfuncs and (--trace or --count)'
,
'-lc'
),
(
b
'argument -R/--no-report: not allowed with argument -r/--report'
,
'-rR'
),
(
b
'must specify one of --trace, --count, --report, --listfuncs, or --trackcalls'
,
'-g'
),
(
b
'-r/--report requires -f/--file'
,
'-r'
),
(
b
'--summary can only be used with --count or --report'
,
'-sT'
),
(
b
'unrecognized arguments: -y'
,
'-y'
))
for
message
,
*
args
in
_errors
:
*
_
,
stderr
=
assert_python_failure
(
'-m'
,
'trace'
,
*
args
)
self
.
assertIn
(
message
,
stderr
)
def
test_listfuncs_flag_success
(
self
):
with
open
(
TESTFN
,
'w'
)
as
fd
:
self
.
addCleanup
(
unlink
,
TESTFN
)
fd
.
write
(
"a = 1
\n
"
)
status
,
stdout
,
stderr
=
assert_python_ok
(
'-m'
,
'trace'
,
'-l'
,
TESTFN
)
self
.
assertIn
(
b
'functions called:'
,
stdout
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Lib/trace.py
Dosyayı görüntüle @
436831db
This diff is collapsed.
Click to expand it.
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