From ca5c92338360cacecc7e7fd9e4a39eb461bf0153 2016-03-08 11:24:51 From: Thomas Kluyver Date: 2016-03-08 11:24:51 Subject: [PATCH] Override terminal size in doctests to standardise traceback format Should fix test failures on Jenkins --- diff --git a/IPython/testing/plugin/ipdoctest.py b/IPython/testing/plugin/ipdoctest.py index 015937b..baebc8b 100644 --- a/IPython/testing/plugin/ipdoctest.py +++ b/IPython/testing/plugin/ipdoctest.py @@ -28,6 +28,8 @@ import sys import traceback import unittest +from testpath import modified_env + from inspect import getmodule # We are overriding the default doctest runner, so we need to import a few @@ -587,8 +589,10 @@ class IPDocTestRunner(doctest.DocTestRunner,object): test.globs.update(_ip.user_ns) - return super(IPDocTestRunner,self).run(test, - compileflags,out,clear_globs) + # Override terminal size to standardise traceback format + with modified_env({'COLUMNS': '80', 'LINES': '24'}): + return super(IPDocTestRunner,self).run(test, + compileflags,out,clear_globs) class DocFileCase(doctest.DocFileCase):