[pypy-commit] pypy py3.5: 'fix' the test by giving the behavior expected on PyPy, which is also (see docstring) more consistent imho.

arigo pypy.commits at gmail.com
Mon Feb 20 12:15:14 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r90234:9e34b1ddde5c
Date: 2017-02-20 18:14 +0100
http://bitbucket.org/pypy/pypy/changeset/9e34b1ddde5c/

Log:	'fix' the test by giving the behavior expected on PyPy, which is
	also (see docstring) more consistent imho.

diff --git a/lib-python/3/test/test_pdb.py b/lib-python/3/test/test_pdb.py
--- a/lib-python/3/test/test_pdb.py
+++ b/lib-python/3/test/test_pdb.py
@@ -914,6 +914,12 @@
 def test_pdb_issue_20766():
     """Test for reference leaks when the SIGINT handler is set.
 
+    Note a fix for PyPy: on CPython, the two iterations through the loop
+    don't stop at the same line each time.  Actually, if the loop
+    iterates more than twice, we have a behavior of period two(!).  This
+    is due to very internal behavior that could be classified as a bug
+    and that PyPy doesn't emulating exactly.
+
     >>> def test_function():
     ...     i = 1
     ...     while i <= 2:
@@ -929,8 +935,8 @@
     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
     (Pdb) continue
     pdb 1: <built-in function default_int_handler>
-    > <doctest test.test_pdb.test_pdb_issue_20766[0]>(5)test_function()
-    -> sess.set_trace(sys._getframe())
+    > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+    -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
     (Pdb) continue
     pdb 2: <built-in function default_int_handler>
     """


More information about the pypy-commit mailing list