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
fa7bec7e
Kaydet (Commit)
fa7bec7e
authored
Mar 22, 2004
tarafından
Nicholas Bastin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test for tight loop line event fix, SF bug #765624
üst
aea9459c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
test_trace.py
Lib/test/test_trace.py
+25
-0
No files found.
Lib/test/test_trace.py
Dosyayı görüntüle @
fa7bec7e
...
...
@@ -141,6 +141,29 @@ ireturn_example.events = [(0, 'call'),
(
4
,
'line'
),
(
4
,
'return'
)]
# Tight loop with while(1) example (SF #765624)
def
tightloop_example
():
items
=
range
(
0
,
3
)
try
:
i
=
0
while
1
:
print
items
[
i
];
i
+=
1
except
IndexError
:
pass
tightloop_example
.
events
=
[(
0
,
'call'
),
(
1
,
'line'
),
(
2
,
'line'
),
(
3
,
'line'
),
(
4
,
'line'
),
(
5
,
'line'
),
(
5
,
'line'
),
(
5
,
'line'
),
(
5
,
'exception'
),
(
6
,
'line'
),
(
7
,
'line'
),
(
7
,
'return'
)]
class
Tracer
:
def
__init__
(
self
):
self
.
events
=
[]
...
...
@@ -194,6 +217,8 @@ class TraceTestCase(unittest.TestCase):
self
.
run_test2
(
settrace_and_raise
)
def
test_10_ireturn
(
self
):
self
.
run_test
(
ireturn_example
)
def
test_11_tightloop
(
self
):
self
.
run_test
(
tightloop_example
)
class
RaisingTraceFuncTestCase
(
unittest
.
TestCase
):
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