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
c19c3960
Commit
c19c3960
authored
Apr 01, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #23821: Fixed test_pdb failure under -O.
parents
05ddbf08
a16de5db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
Lib/test/test_pdb.py
Lib/test/test_pdb.py
+15
-11
No files found.
Lib/test/test_pdb.py
View file @
c19c3960
...
...
@@ -677,10 +677,12 @@ def test_pdb_next_command_for_generator():
... import pdb; pdb.Pdb(nosigint=True).set_trace()
... it = test_gen()
... try:
... assert next(it) == 0
... if next(it) != 0:
... raise AssertionError
... next(it)
... except StopIteration as ex:
... assert ex.value == 1
... if ex.value != 1:
... raise AssertionError
... print("finished")
>>> with PdbTestInput(['step',
...
...
@@ -699,7 +701,7 @@ def test_pdb_next_command_for_generator():
-> try:
(Pdb) step
> <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(5)test_function()
->
assert next(it) == 0
->
if next(it) != 0:
(Pdb) step
--Call--
> <doctest test.test_pdb.test_pdb_next_command_for_generator[0]>(1)test_gen()
...
...
@@ -716,7 +718,7 @@ def test_pdb_next_command_for_generator():
-> return 1
(Pdb) step
StopIteration: 1
> <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(
6
)test_function()
> <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(
7
)test_function()
-> next(it)
(Pdb) continue
finished
...
...
@@ -735,10 +737,12 @@ def test_pdb_return_command_for_generator():
... import pdb; pdb.Pdb(nosigint=True).set_trace()
... it = test_gen()
... try:
... assert next(it) == 0
... if next(it) != 0:
... raise AssertionError
... next(it)
... except StopIteration as ex:
... assert ex.value == 1
... if ex.value != 1:
... raise AssertionError
... print("finished")
>>> with PdbTestInput(['step',
...
...
@@ -756,21 +760,21 @@ def test_pdb_return_command_for_generator():
-> try:
(Pdb) step
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(5)test_function()
->
assert next(it) == 0
->
if next(it) != 0:
(Pdb) step
--Call--
> <doctest test.test_pdb.test_pdb_return_command_for_generator[0]>(1)test_gen()
-> def test_gen():
(Pdb) return
StopIteration: 1
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(
6
)test_function()
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(
7
)test_function()
-> next(it)
(Pdb) step
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(
7
)test_function()
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(
8
)test_function()
-> except StopIteration as ex:
(Pdb) step
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(
8
)test_function()
->
assert ex.value == 1
> <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(
9
)test_function()
->
if ex.value != 1:
(Pdb) continue
finished
"""
...
...
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