Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4da2fa55
Commit
4da2fa55
authored
Jun 04, 2009
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for #3684.
parent
e7dbebba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Lib/test/test_traceback.py
Lib/test/test_traceback.py
+9
-0
No files found.
Lib/test/test_traceback.py
View file @
4da2fa55
...
...
@@ -24,6 +24,9 @@ class TracebackCases(unittest.TestCase):
def
syntax_error_with_caret
(
self
):
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
):
# XXX why doesn't compile raise the same traceback?
import
test.badsyntax_nocaret
...
...
@@ -39,6 +42,12 @@ class TracebackCases(unittest.TestCase):
self
.
assert_
(
"^"
in
err
[
2
])
# third line has caret
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
):
if
is_jython
:
# 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