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
aea9459c
Kaydet (Commit)
aea9459c
authored
Mar 22, 2004
tarafından
Nicholas Bastin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test for lack of implicit return line event
üst
80d937e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
test_trace.py
Lib/test/test_trace.py
+27
-9
No files found.
Lib/test/test_trace.py
Dosyayı görüntüle @
aea9459c
...
@@ -125,6 +125,22 @@ settrace_and_raise.events = [(2, 'exception'),
...
@@ -125,6 +125,22 @@ settrace_and_raise.events = [(2, 'exception'),
(
4
,
'line'
),
(
4
,
'line'
),
(
4
,
'return'
)]
(
4
,
'return'
)]
# implicit return example
def
ireturn_example
():
a
=
5
b
=
5
if
a
==
b
:
b
=
a
+
1
else
:
pass
ireturn_example
.
events
=
[(
0
,
'call'
),
(
1
,
'line'
),
(
2
,
'line'
),
(
3
,
'line'
),
(
4
,
'line'
),
(
4
,
'return'
)]
class
Tracer
:
class
Tracer
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
events
=
[]
self
.
events
=
[]
...
@@ -157,25 +173,27 @@ class TraceTestCase(unittest.TestCase):
...
@@ -157,25 +173,27 @@ class TraceTestCase(unittest.TestCase):
self
.
compare_events
(
func
.
func_code
.
co_firstlineno
,
self
.
compare_events
(
func
.
func_code
.
co_firstlineno
,
tracer
.
events
,
func
.
events
)
tracer
.
events
,
func
.
events
)
def
test_1_basic
(
self
):
def
test_
0
1_basic
(
self
):
self
.
run_test
(
basic
)
self
.
run_test
(
basic
)
def
test_2_arigo
(
self
):
def
test_
0
2_arigo
(
self
):
self
.
run_test
(
arigo_example
)
self
.
run_test
(
arigo_example
)
def
test_3_one_instr
(
self
):
def
test_
0
3_one_instr
(
self
):
self
.
run_test
(
one_instr_line
)
self
.
run_test
(
one_instr_line
)
def
test_4_no_pop_blocks
(
self
):
def
test_
0
4_no_pop_blocks
(
self
):
self
.
run_test
(
no_pop_blocks
)
self
.
run_test
(
no_pop_blocks
)
def
test_5_no_pop_tops
(
self
):
def
test_
0
5_no_pop_tops
(
self
):
self
.
run_test
(
no_pop_tops
)
self
.
run_test
(
no_pop_tops
)
def
test_6_call
(
self
):
def
test_
0
6_call
(
self
):
self
.
run_test
(
call
)
self
.
run_test
(
call
)
def
test_7_raise
(
self
):
def
test_
0
7_raise
(
self
):
self
.
run_test
(
test_raise
)
self
.
run_test
(
test_raise
)
def
test_8_settrace_and_return
(
self
):
def
test_
0
8_settrace_and_return
(
self
):
self
.
run_test2
(
settrace_and_return
)
self
.
run_test2
(
settrace_and_return
)
def
test_9_settrace_and_raise
(
self
):
def
test_
0
9_settrace_and_raise
(
self
):
self
.
run_test2
(
settrace_and_raise
)
self
.
run_test2
(
settrace_and_raise
)
def
test_10_ireturn
(
self
):
self
.
run_test
(
ireturn_example
)
class
RaisingTraceFuncTestCase
(
unittest
.
TestCase
):
class
RaisingTraceFuncTestCase
(
unittest
.
TestCase
):
def
trace
(
self
,
frame
,
event
,
arg
):
def
trace
(
self
,
frame
,
event
,
arg
):
...
...
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