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
34748cd6
Kaydet (Commit)
34748cd6
authored
Ara 04, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test suite to not activate new sigint behavior in pdb.
üst
f3fa5685
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
doctest.py
Lib/doctest.py
+6
-3
test_pdb.py
Lib/test/test_pdb.py
+12
-11
test_zipimport_support.py
Lib/test/test_zipimport_support.py
+1
-1
No files found.
Lib/doctest.py
Dosyayı görüntüle @
34748cd6
...
...
@@ -318,7 +318,8 @@ class _OutputRedirectingPdb(pdb.Pdb):
def
__init__
(
self
,
out
):
self
.
__out
=
out
self
.
__debugger_used
=
False
pdb
.
Pdb
.
__init__
(
self
,
stdout
=
out
)
# do not play signal games in the pdb
pdb
.
Pdb
.
__init__
(
self
,
stdout
=
out
,
nosigint
=
True
)
# still use input() to get user input
self
.
use_rawinput
=
1
...
...
@@ -2528,14 +2529,16 @@ def debug_script(src, pm=False, globs=None):
exec
(
f
.
read
(),
globs
,
globs
)
except
:
print
(
sys
.
exc_info
()[
1
])
pdb
.
post_mortem
(
sys
.
exc_info
()[
2
])
p
=
pdb
.
Pdb
(
nosigint
=
True
)
p
.
reset
()
p
.
interaction
(
None
,
sys
.
exc_info
()[
2
])
else
:
fp
=
open
(
srcfilename
)
try
:
script
=
fp
.
read
()
finally
:
fp
.
close
()
pdb
.
run
(
"exec(
%
r)"
%
script
,
globs
,
globs
)
pdb
.
Pdb
(
nosigint
=
True
)
.
run
(
"exec(
%
r)"
%
script
,
globs
,
globs
)
finally
:
os
.
remove
(
srcfilename
)
...
...
Lib/test/test_pdb.py
Dosyayı görüntüle @
34748cd6
...
...
@@ -29,7 +29,7 @@ def test_pdb_displayhook():
"""This tests the custom displayhook for pdb.
>>> def test_function(foo, bar):
... import pdb; pdb.Pdb().set_trace()
... import pdb; pdb.Pdb(
nosigint=True
).set_trace()
... pass
>>> with PdbTestInput([
...
...
@@ -69,7 +69,7 @@ def test_pdb_basic_commands():
... return foo.upper()
>>> def test_function():
... import pdb; pdb.Pdb().set_trace()
... import pdb; pdb.Pdb(
nosigint=True
).set_trace()
... ret = test_function_2('baz')
... print(ret)
...
...
@@ -168,7 +168,7 @@ def test_pdb_breakpoint_commands():
"""Test basic commands related to breakpoints.
>>> def test_function():
... import pdb; pdb.Pdb().set_trace()
... import pdb; pdb.Pdb(
nosigint=True
).set_trace()
... print(1)
... print(2)
... print(3)
...
...
@@ -297,7 +297,7 @@ def test_list_commands():
... return foo
>>> def test_function():
... import pdb; pdb.Pdb().set_trace()
... import pdb; pdb.Pdb(
nosigint=True
).set_trace()
... ret = test_function_2('baz')
>>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
...
...
@@ -320,7 +320,7 @@ def test_list_commands():
-> ret = test_function_2('baz')
(Pdb) list
1 def test_function():
2 import pdb; pdb.Pdb().set_trace()
2 import pdb; pdb.Pdb(
nosigint=True
).set_trace()
3 -> ret = test_function_2('baz')
[EOF]
(Pdb) step
...
...
@@ -383,7 +383,7 @@ def test_post_mortem():
... print('Exception!')
>>> def test_function():
... import pdb; pdb.Pdb().set_trace()
... import pdb; pdb.Pdb(
nosigint=True
).set_trace()
... test_function_2()
... print('Not reached.')
...
...
@@ -416,7 +416,7 @@ def test_post_mortem():
-> 1/0
(Pdb) list
1 def test_function():
2 import pdb; pdb.Pdb().set_trace()
2 import pdb; pdb.Pdb(
nosigint=True
).set_trace()
3 -> test_function_2()
4 print('Not reached.')
[EOF]
...
...
@@ -440,7 +440,7 @@ def test_pdb_skip_modules():
>>> def skip_module():
... import string
... import pdb; pdb.Pdb(skip=['stri*']).set_trace()
... import pdb; pdb.Pdb(skip=['stri*']
, nosigint=True
).set_trace()
... string.capwords('FOO')
>>> with PdbTestInput([
...
...
@@ -469,7 +469,7 @@ def test_pdb_skip_modules_with_callback():
>>> def skip_module():
... def callback():
... return None
... import pdb; pdb.Pdb(skip=['module_to_skip*']).set_trace()
... import pdb; pdb.Pdb(skip=['module_to_skip*']
, nosigint=True
).set_trace()
... mod.foo_pony(callback)
>>> with PdbTestInput([
...
...
@@ -510,7 +510,7 @@ def test_pdb_continue_in_bottomframe():
"""Test that "continue" and "next" work properly in bottom frame (issue #5294).
>>> def test_function():
... import pdb, sys; inst = pdb.Pdb()
... import pdb, sys; inst = pdb.Pdb(
nosigint=True
)
... inst.set_trace()
... inst.botframe = sys._getframe() # hackery to get the right botframe
... print(1)
...
...
@@ -550,7 +550,8 @@ def test_pdb_continue_in_bottomframe():
def
pdb_invoke
(
method
,
arg
):
"""Run pdb.method(arg)."""
import
pdb
;
getattr
(
pdb
,
method
)(
arg
)
import
pdb
getattr
(
pdb
.
Pdb
(
nosigint
=
True
),
method
)(
arg
)
def
test_pdb_run_with_incorrect_argument
():
...
...
Lib/test/test_zipimport_support.py
Dosyayı görüntüle @
34748cd6
...
...
@@ -200,7 +200,7 @@ class ZipSupportTests(ImportHooksBaseTestCase):
pass
import pdb
pdb.runcall(f)
pdb.
Pdb(nosigint=True).
runcall(f)
"""
)
with
temp_dir
()
as
d
:
script_name
=
make_script
(
d
,
'script'
,
test_src
)
...
...
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