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
9c3597d4
Kaydet (Commit)
9c3597d4
authored
Tem 28, 2010
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reverted r83142: bad svnmerge
üst
73363e81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
test_profilehooks.py
Lib/test/test_profilehooks.py
+18
-18
test_sys.py
Lib/test/test_sys.py
+2
-2
test_sys_settrace.py
Lib/test/test_sys_settrace.py
+0
-0
No files found.
Lib/test/test_
sys_setprofile
.py
→
Lib/test/test_
profilehooks
.py
Dosyayı görüntüle @
9c3597d4
...
...
@@ -2,7 +2,7 @@ import pprint
import
sys
import
unittest
from
test
import
support
from
test
import
test_
support
class
TestGetProfile
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -47,7 +47,7 @@ class HookWatcher:
def
get_events
(
self
):
"""Remove calls to add_event()."""
disallowed
=
[
ident
(
self
.
add_event
.
__func__
),
ident
(
ident
)]
disallowed
=
[
ident
(
self
.
add_event
.
im_func
),
ident
(
ident
)]
self
.
frames
=
None
return
[
item
for
item
in
self
.
events
if
item
[
2
]
not
in
disallowed
]
...
...
@@ -110,7 +110,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_exception
(
self
):
def
f
(
p
):
1
/
0
1
.
/
0
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
(
1
,
'return'
,
f_ident
),
...
...
@@ -118,7 +118,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_caught_exception
(
self
):
def
f
(
p
):
try
:
1
/
0
try
:
1
.
/
0
except
:
pass
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
...
...
@@ -127,7 +127,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_caught_nested_exception
(
self
):
def
f
(
p
):
try
:
1
/
0
try
:
1
.
/
0
except
:
pass
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
...
...
@@ -136,7 +136,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_nested_exception
(
self
):
def
f
(
p
):
1
/
0
1
.
/
0
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
# This isn't what I expected:
...
...
@@ -147,7 +147,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_exception_in_except_clause
(
self
):
def
f
(
p
):
1
/
0
1
.
/
0
def
g
(
p
):
try
:
f
(
p
)
...
...
@@ -166,7 +166,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_exception_propogation
(
self
):
def
f
(
p
):
1
/
0
1
.
/
0
def
g
(
p
):
try
:
f
(
p
)
finally
:
p
.
add_event
(
"falling through"
)
...
...
@@ -181,8 +181,8 @@ class ProfileHookTestCase(TestCaseBase):
def
test_raise_twice
(
self
):
def
f
(
p
):
try
:
1
/
0
except
:
1
/
0
try
:
1
.
/
0
except
:
1
.
/
0
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
(
1
,
'return'
,
f_ident
),
...
...
@@ -190,7 +190,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_raise_reraise
(
self
):
def
f
(
p
):
try
:
1
/
0
try
:
1
.
/
0
except
:
raise
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
...
...
@@ -207,7 +207,7 @@ class ProfileHookTestCase(TestCaseBase):
def
test_distant_exception
(
self
):
def
f
():
1
/
0
1
.
/
0
def
g
():
f
()
def
h
():
...
...
@@ -292,7 +292,7 @@ class ProfileSimulatorTestCase(TestCaseBase):
def
test_basic_exception
(
self
):
def
f
(
p
):
1
/
0
1
.
/
0
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
(
1
,
'return'
,
f_ident
),
...
...
@@ -300,7 +300,7 @@ class ProfileSimulatorTestCase(TestCaseBase):
def
test_caught_exception
(
self
):
def
f
(
p
):
try
:
1
/
0
try
:
1
.
/
0
except
:
pass
f_ident
=
ident
(
f
)
self
.
check_events
(
f
,
[(
1
,
'call'
,
f_ident
),
...
...
@@ -309,7 +309,7 @@ class ProfileSimulatorTestCase(TestCaseBase):
def
test_distant_exception
(
self
):
def
f
():
1
/
0
1
.
/
0
def
g
():
f
()
def
h
():
...
...
@@ -340,7 +340,7 @@ def ident(function):
if
hasattr
(
function
,
"f_code"
):
code
=
function
.
f_code
else
:
code
=
function
.
__code__
code
=
function
.
func_code
return
code
.
co_firstlineno
,
code
.
co_name
...
...
@@ -357,7 +357,7 @@ def capture_events(callable, p=None):
except
TypeError
:
pass
else
:
raise
support
.
TestFailed
(
raise
test_
support
.
TestFailed
(
'sys.setprofile() did not raise TypeError'
)
if
p
is
None
:
...
...
@@ -374,7 +374,7 @@ def show_events(callable):
def
test_main
():
support
.
run_unittest
(
test_
support
.
run_unittest
(
TestGetProfile
,
ProfileHookTestCase
,
ProfileSimulatorTestCase
...
...
Lib/test/test_sys.py
Dosyayı görüntüle @
9c3597d4
...
...
@@ -205,8 +205,8 @@ class SysModuleTest(unittest.TestCase):
# can't check more than the type, as the user might have changed it
self
.
assertIsInstance
(
sys
.
getdefaultencoding
(),
str
)
# testing sys.settrace() is done in test_
sys_set
trace.py
# testing sys.setprofile() is done in test_
sys_set
profile.py
# testing sys.settrace() is done in test_trace.py
# testing sys.setprofile() is done in test_profile.py
def
test_setcheckinterval
(
self
):
self
.
assertRaises
(
TypeError
,
sys
.
setcheckinterval
)
...
...
Lib/test/test_sys_settrace.py
deleted
100644 → 0
Dosyayı görüntüle @
73363e81
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