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
77cd2585
Kaydet (Commit)
77cd2585
authored
Ara 09, 2011
tarafından
Jason R. Coombs
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implemented suggested improvements for pdb test by Éric Araujo
üst
2bc1e8fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
test_pdb.py
Lib/test/test_pdb.py
+19
-18
No files found.
Lib/test/test_pdb.py
Dosyayı görüntüle @
77cd2585
...
...
@@ -280,35 +280,36 @@ def test_pdb_continue_in_bottomframe():
4
"""
class
Tester7750
(
unittest
.
TestCase
):
# if the filename has something that resolves to a python
# escape character (such as \t), it will fail
test_fn
=
'.
\\
test7750.py'
msg
=
"issue7750 only applies when os.sep is a backslash"
@unittest.skipUnless
(
os
.
path
.
sep
==
'
\\
'
,
msg
)
def
test_issue7750
(
self
):
with
open
(
self
.
test_fn
,
'w'
)
as
f
:
f
.
write
(
'print("hello world")'
)
cmd
=
[
sys
.
executable
,
'-m'
,
'pdb'
,
self
.
test_fn
,]
class
ModuleInitTester
(
unittest
.
TestCase
):
def
test_filename_correct
(
self
):
"""
In issue 7750, it was found that if the filename has a sequence that
resolves to an escape character in a Python string (such as
\t
), it
will be treated as the escaped character.
"""
# the test_fn must contain something like \t
# on Windows, this will create 'test_mod.py' in the current directory.
# on Unix, this will create '.\test_mod.py' in the current directory.
test_fn
=
'.
\\
test_mod.py'
code
=
'print("testing pdb")'
with
open
(
test_fn
,
'w'
)
as
f
:
f
.
write
(
code
)
self
.
addCleanup
(
os
.
remove
,
test_fn
)
cmd
=
[
sys
.
executable
,
'-m'
,
'pdb'
,
test_fn
,]
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
)
stdout
,
stderr
=
proc
.
communicate
(
'quit
\n
'
)
self
.
assertNotIn
(
'IOError'
,
stdout
,
"pdb munged the filename"
)
def
tearDown
(
self
):
if
os
.
path
.
isfile
(
self
.
test_fn
):
os
.
remove
(
self
.
test_fn
)
self
.
assertIn
(
code
,
stdout
,
"pdb munged the filename"
)
def
test_main
():
from
test
import
test_pdb
test_support
.
run_doctest
(
test_pdb
,
verbosity
=
True
)
test_support
.
run_unittest
(
ModuleInitTester
)
if
__name__
==
'__main__'
:
test_main
()
unittest
.
main
()
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