From 71b3a3dca1deb73d3d5c8f41cec31f757cd096cd 2011-11-02 19:21:49 From: Thomas Kluyver Date: 2011-11-02 19:21:49 Subject: [PATCH] Disable the pager for the test suite. closes gh-949 closes gh-961 --- diff --git a/IPython/core/tests/test_page.py b/IPython/core/tests/test_page.py index 28b23f8..a79fbfd 100644 --- a/IPython/core/tests/test_page.py +++ b/IPython/core/tests/test_page.py @@ -7,6 +7,7 @@ #----------------------------------------------------------------------------- import io +# N.B. For the test suite, page.page is overridden (see IPython.testing.globalipapp) from IPython.core import page def test_detect_screen_size(): diff --git a/IPython/testing/globalipapp.py b/IPython/testing/globalipapp.py index 0a4231c..82b33c4 100644 --- a/IPython/testing/globalipapp.py +++ b/IPython/testing/globalipapp.py @@ -27,6 +27,7 @@ import sys # our own from . import tools +from IPython.core import page from IPython.utils import io from IPython.utils import py3compat from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell @@ -228,5 +229,12 @@ def start_ipython(): # To avoid extra IPython messages during testing, suppress io.stdout/stderr io.stdout = StreamProxy('stdout') io.stderr = StreamProxy('stderr') + + # Override paging, so we don't require user interaction during the tests. + def nopage(strng, start=0, screen_lines=0, pager_cmd=None): + print(strng) + + page.orig_page = page.page + page.page = nopage return _ip