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
e8ed9655
Commit
e8ed9655
authored
Jan 01, 2018
by
Serhiy Storchaka
Committed by
GitHub
Jan 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-32416: Add two new tests in test_sys_settrace. (#5072)
Move other test to more proper place.
parent
14709144
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
Lib/test/test_sys_settrace.py
Lib/test/test_sys_settrace.py
+30
-8
No files found.
Lib/test/test_sys_settrace.py
View file @
e8ed9655
...
@@ -789,6 +789,14 @@ class JumpTestCase(unittest.TestCase):
...
@@ -789,6 +789,14 @@ class JumpTestCase(unittest.TestCase):
output
.
append
(
6
)
output
.
append
(
6
)
output
.
append
(
7
)
output
.
append
(
7
)
@
jump_test
(
2
,
4
,
[
1
,
4
,
5
,
-
4
])
def
test_jump_across_with
(
output
):
output
.
append
(
1
)
with
tracecontext
(
output
,
2
):
output
.
append
(
3
)
with
tracecontext
(
output
,
4
):
output
.
append
(
5
)
@
jump_test
(
8
,
11
,
[
1
,
3
,
5
,
11
,
12
])
@
jump_test
(
8
,
11
,
[
1
,
3
,
5
,
11
,
12
])
def
test_jump_out_of_complex_nested_blocks
(
output
):
def
test_jump_out_of_complex_nested_blocks
(
output
):
output
.
append
(
1
)
output
.
append
(
1
)
...
@@ -840,6 +848,17 @@ class JumpTestCase(unittest.TestCase):
...
@@ -840,6 +848,17 @@ class JumpTestCase(unittest.TestCase):
break
break
output
.
append
(
13
)
output
.
append
(
13
)
@
jump_test
(
1
,
7
,
[
7
,
8
])
def
test_jump_over_for_block_before_else
(
output
):
output
.
append
(
1
)
if
not
output
:
# always false
for
i
in
[
3
]:
output
.
append
(
4
)
else
:
output
.
append
(
6
)
output
.
append
(
7
)
output
.
append
(
8
)
# The second set of 'jump' tests are for things that are not allowed:
# The second set of 'jump' tests are for things that are not allowed:
@
jump_test
(
2
,
3
,
[
1
],
(
ValueError
,
'after'
))
@
jump_test
(
2
,
3
,
[
1
],
(
ValueError
,
'after'
))
...
@@ -997,21 +1016,24 @@ class JumpTestCase(unittest.TestCase):
...
@@ -997,21 +1016,24 @@ class JumpTestCase(unittest.TestCase):
finally
:
finally
:
output
.
append
(
5
)
output
.
append
(
5
)
@
jump_test
(
2
,
4
,
[
1
,
4
,
5
,
-
4
]
)
@
jump_test
(
3
,
5
,
[
1
,
2
,
-
2
],
(
ValueError
,
'into'
)
)
def
test_
jump_across_with
(
output
):
def
test_
no_jump_between_with_blocks
(
output
):
output
.
append
(
1
)
output
.
append
(
1
)
with
tracecontext
(
output
,
2
):
with
tracecontext
(
output
,
2
):
output
.
append
(
3
)
output
.
append
(
3
)
with
tracecontext
(
output
,
4
):
with
tracecontext
(
output
,
4
):
output
.
append
(
5
)
output
.
append
(
5
)
@
jump_test
(
3
,
5
,
[
1
,
2
,
-
2
],
(
ValueError
,
'into'
))
@
jump_test
(
7
,
4
,
[
1
,
6
],
(
ValueError
,
'into'
))
def
test_
jump_across_with_2
(
output
):
def
test_
no_jump_into_for_block_before_else
(
output
):
output
.
append
(
1
)
output
.
append
(
1
)
with
tracecontext
(
output
,
2
):
if
not
output
:
# always false
output
.
append
(
3
)
for
i
in
[
3
]:
with
tracecontext
(
output
,
4
):
output
.
append
(
4
)
output
.
append
(
5
)
else
:
output
.
append
(
6
)
output
.
append
(
7
)
output
.
append
(
8
)
def
test_no_jump_to_non_integers
(
self
):
def
test_no_jump_to_non_integers
(
self
):
self
.
run_test
(
no_jump_to_non_integers
,
2
,
"Spam"
,
[
True
])
self
.
run_test
(
no_jump_to_non_integers
,
2
,
"Spam"
,
[
True
])
...
...
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