classification
Title: Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb
Type: behavior Stage: patch review
Components: Tests Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, xdegaye, xtreak
Priority: normal Keywords: patch

Created on 2018-06-03 15:43 by serhiy.storchaka, last changed 2018-11-04 04:49 by xtreak.

Pull Requests
URL Status Linked Edit
PR 7563 open xdegaye, 2018-06-09 16:25
Messages (2)
msg318560 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-03 15:43
$ ./python -m test -v -m test_pdb_next_command_in_generator_for_loop test_pdb
...
test_pdb_next_command_in_generator_for_loop (test.test_pdb)
Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop ... FAIL

======================================================================
FAIL: test_pdb_next_command_in_generator_for_loop (test.test_pdb)
Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython-tmp2/Lib/doctest.py", line 2193, in runTest
    test, out=new.write, clear_globs=False)
AssertionError: Failed doctest test for test.test_pdb.test_pdb_next_command_in_generator_for_loop
  File "/home/serhiy/py/cpython-tmp2/Lib/test/test_pdb.py", line 1035, in test_pdb_next_command_in_generator_for_loop

----------------------------------------------------------------------
File "/home/serhiy/py/cpython-tmp2/Lib/test/test_pdb.py", line 1048, in test.test_pdb.test_pdb_next_command_in_generator_for_loop
Failed example:
    with PdbTestInput(['break test_gen',
                       'continue',
                       'next',
                       'next',
                       'next',
                       'continue']):
        test_function()
Expected:
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
    -> for i in test_gen():
    (Pdb) break test_gen
    Breakpoint 6 at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1
    (Pdb) continue
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(2)test_gen()
    -> yield 0
    (Pdb) next
    value 0
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(3)test_gen()
    -> return 1
    (Pdb) next
    Internal StopIteration: 1
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
    -> for i in test_gen():
    (Pdb) next
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(5)test_function()
    -> x = 123
    (Pdb) continue
Got:
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
    -> for i in test_gen():
    (Pdb) break test_gen
    Breakpoint 1 at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1
    (Pdb) continue
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(2)test_gen()
    -> yield 0
    (Pdb) next
    value 0
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(3)test_gen()
    -> return 1
    (Pdb) next
    Internal StopIteration: 1
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
    -> for i in test_gen():
    (Pdb) next
    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(5)test_function()
    -> x = 123
    (Pdb) continue


----------------------------------------------------------------------
msg319144 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2018-06-09 12:06
This is fixed with:

diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 4f9d28afd3..7b3624fb99 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -1045,7 +1045,7 @@ def test_pdb_next_command_in_generator_for_loop():
     ...         print('value', i)
     ...     x = 123
 
-    >>> with PdbTestInput(['break test_gen',
+    >>> with PdbTestInput(['break test_gen', # doctest: +ELLIPSIS
     ...                    'continue',
     ...                    'next',
     ...                    'next',
@@ -1055,7 +1055,7 @@ def test_pdb_next_command_in_generator_for_loop():
     > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
     -> for i in test_gen():
     (Pdb) break test_gen
-    Breakpoint 6 at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1
+    Breakpoint ... at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1
     (Pdb) continue
     > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(2)test_gen()
     -> yield 0

I will submit a PR shortly.
History
Date User Action Args
2018-11-04 04:49:27xtreaksetnosy: + xtreak
2018-06-09 16:25:31xdegayesetkeywords: + patch
stage: patch review
pull_requests: + pull_request7195
2018-06-09 12:06:29xdegayesetnosy: + xdegaye
messages: + msg319144
2018-06-03 15:43:25serhiy.storchakacreate