Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
I rarely run whole test suite locally, so I'm not sure when it was broken. IIRC, after merging new repl.
BTW, setting PYTHON_BASIC_REPL doesn't help.
$ cat ~/.pdbrc alias si from cmath import sin; sin(%1) $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm $ ./configure -q && make -s [just stuff from 108562] $ ./python -m test test_doctest -v [...] ====================================================================== FAIL: test_debug (test.test_doctest.test_doctest) Doctest: test.test_doctest.test_doctest.test_debug ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sk/src/cpython/Lib/doctest.py", line 2327, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_doctest.test_doctest.test_debug File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 1992, in test_debug ---------------------------------------------------------------------- File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2010, in test.test_doctest.test_doctest.test_debug Failed example: try: doctest.debug_src(s) finally: sys.stdin = real_stdin Expected: > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print(x) 12 (Pdb) continue Got: (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print(x) 12 (Pdb) continue ====================================================================== FAIL: test_pdb_set_trace (test.test_doctest.test_doctest) Doctest: test.test_doctest.test_doctest.test_pdb_set_trace ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sk/src/cpython/Lib/doctest.py", line 2327, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_doctest.test_doctest.test_pdb_set_trace File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2024, in test_pdb_set_trace ---------------------------------------------------------------------- File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2057, in test.test_doctest.test_doctest.test_pdb_set_trace Failed example: try: runner.run(test) finally: sys.stdin = real_stdin Expected: > <doctest foo-bar@baz[2]>(1)<module>() -> import pdb; pdb.set_trace() (Pdb) print(x) 42 (Pdb) continue TestResults(failed=0, attempted=3) Got: (Pdb) print(x) 42 (Pdb) continue TestResults(failed=0, attempted=3) ---------------------------------------------------------------------- ile "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2085, in test.test_doctest.test_doctest.test_pdb_set_trace Failed example: try: runner.run(test) finally: sys.stdin = real_stdin Expected: > <doctest test.test_doctest.test_doctest.test_pdb_set_trace[9]>(3)calls_set_trace() -> import pdb; pdb.set_trace() (Pdb) print(y) 2 (Pdb) up > <doctest foo-bar@baz[1]>(1)<module>() -> calls_set_trace() (Pdb) print(x) 1 (Pdb) continue TestResults(failed=0, attempted=2) Got: (Pdb) print(y) 2 (Pdb) up > <doctest foo-bar@baz[1]>(1)<module>() -> calls_set_trace() (Pdb) print(x) 1 (Pdb) continue TestResults(failed=0, attempted=2) ---------------------------------------------------------------------- ---------------------------------------------------------------------- File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2123, in test.test_doctest.test_doctest.test_pdb_set_trace Failed example: try: runner.run(test) finally: sys.stdin = real_stdin # doctest: +NORMALIZE_WHITESPACE Expected: > <doctest foo-bar@baz[1]>(3)g() -> import pdb; pdb.set_trace() (Pdb) step --Return-- > <doctest foo-bar@baz[1]>(3)g()->None -> import pdb; pdb.set_trace() (Pdb) list 1 def g(x): 2 print(x+3) 3 -> import pdb; pdb.set_trace() [EOF] (Pdb) next --Return-- > <doctest foo-bar@baz[0]>(2)f()->None -> g(x*2) (Pdb) list 1 def f(x): 2 -> g(x*2) [EOF] (Pdb) next --Return-- > <doctest foo-bar@baz[2]>(1)<module>()->None -> f(3) (Pdb) list 1 -> f(3) [EOF] (Pdb) continue ********************************************************************** File "foo-bar@baz.py", line 7, in foo-bar@baz Failed example: f(3) Expected nothing Got: 9 TestResults(failed=1, attempted=3) Got: (Pdb) step --Return-- > <doctest foo-bar@baz[1]>(3)g()->None -> import pdb; pdb.set_trace() (Pdb) list 1 def g(x): 2 print(x+3) 3 -> import pdb; pdb.set_trace() [EOF] (Pdb) next --Return-- > <doctest foo-bar@baz[0]>(2)f()->None -> g(x*2) (Pdb) list 1 def f(x): 2 -> g(x*2) [EOF] (Pdb) next --Return-- > <doctest foo-bar@baz[2]>(1)<module>()->None -> f(3) (Pdb) list 1 -> f(3) [EOF] (Pdb) continue ********************************************************************** File "foo-bar@baz.py", line 7, in foo-bar@baz Failed example: f(3) Expected nothing Got: 9 TestResults(failed=1, attempted=3) ====================================================================== FAIL: test_pdb_set_trace_nested (test.test_doctest.test_doctest) Doctest: test.test_doctest.test_doctest.test_pdb_set_trace_nested ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sk/src/cpython/Lib/doctest.py", line 2327, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_doctest.test_doctest.test_pdb_set_trace_nested File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2165, in test_pdb_set_trace_nested ---------------------------------------------------------------------- File "/home/sk/src/cpython/Lib/test/test_doctest/test_doctest.py", line 2202, in test.test_doctest.test_doctest.test_pdb_set_trace_neste d Failed example: try: runner.run(test) finally: sys.stdin = real_stdin # doctest: +REPORT_NDIFF Differences (ndiff with -expected +actual): - > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(4)calls_set_trace() - -> import pdb; pdb.set_trace() (Pdb) step > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(5)calls_set_trace() -> self.f1() (Pdb) print(y) 1 (Pdb) step --Call-- > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(7)f1() -> def f1(self): (Pdb) step > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(8)f1() -> x = 1 (Pdb) step > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(9)f1() -> self.f2() (Pdb) step --Call-- > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(11)f2() -> def f2(self): (Pdb) step > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(12)f2() -> z = 1 (Pdb) step > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(13)f2() -> z = 2 (Pdb) print(z) 1 (Pdb) up > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(9)f1() -> self.f2() (Pdb) print(x) 1 (Pdb) up > <doctest test.test_doctest.test_doctest.test_pdb_set_trace_nested[0]>(5)calls_set_trace() -> self.f1() (Pdb) print(y) 1 (Pdb) up > <doctest foo-bar@baz[1]>(1)<module>() -> calls_set_trace() (Pdb) print(foo) *** NameError: name 'foo' is not defined (Pdb) continue TestResults(failed=0, attempted=2) ---------------------------------------------------------------------- Ran 69 tests in 4.415s FAILED (failures=3) test test_doctest failed test_doctest failed (3 failures) == Tests result: FAILURE == 1 test failed: test_doctest Total duration: 5.4 sec Total tests: run=69 failures=3 Total test files: run=1/1 failed=1 Result: FAILURE CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error