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
4da2fa55
Kaydet (Commit)
4da2fa55
authored
Haz 04, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for #3684.
üst
e7dbebba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
test_traceback.py
Lib/test/test_traceback.py
+9
-0
No files found.
Lib/test/test_traceback.py
Dosyayı görüntüle @
4da2fa55
...
@@ -24,6 +24,9 @@ class TracebackCases(unittest.TestCase):
...
@@ -24,6 +24,9 @@ class TracebackCases(unittest.TestCase):
def
syntax_error_with_caret
(
self
):
def
syntax_error_with_caret
(
self
):
compile
(
"def fact(x):
\n\t
return x!
\n
"
,
"?"
,
"exec"
)
compile
(
"def fact(x):
\n\t
return x!
\n
"
,
"?"
,
"exec"
)
def
syntax_error_with_caret_2
(
self
):
compile
(
"1 +
\n
"
,
"?"
,
"exec"
)
def
syntax_error_without_caret
(
self
):
def
syntax_error_without_caret
(
self
):
# XXX why doesn't compile raise the same traceback?
# XXX why doesn't compile raise the same traceback?
import
test.badsyntax_nocaret
import
test.badsyntax_nocaret
...
@@ -39,6 +42,12 @@ class TracebackCases(unittest.TestCase):
...
@@ -39,6 +42,12 @@ class TracebackCases(unittest.TestCase):
self
.
assert_
(
"^"
in
err
[
2
])
# third line has caret
self
.
assert_
(
"^"
in
err
[
2
])
# third line has caret
self
.
assert_
(
err
[
1
]
.
find
(
"!"
)
==
err
[
2
]
.
find
(
"^"
))
# in the right place
self
.
assert_
(
err
[
1
]
.
find
(
"!"
)
==
err
[
2
]
.
find
(
"^"
))
# in the right place
err
=
self
.
get_exception_format
(
self
.
syntax_error_with_caret_2
,
SyntaxError
)
self
.
assert_
(
"^"
in
err
[
2
])
# third line has caret
self
.
assert_
(
err
[
2
]
.
count
(
'
\n
'
)
==
1
)
# and no additional newline
self
.
assert_
(
err
[
1
]
.
find
(
"+"
)
==
err
[
2
]
.
find
(
"^"
))
# in the right place
def
test_nocaret
(
self
):
def
test_nocaret
(
self
):
if
is_jython
:
if
is_jython
:
# jython adds a caret in this case (why shouldn't it?)
# jython adds a caret in this case (why shouldn't 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