From 58ddb7de8e3e6030074f41d7db356f4a2644b3be 2016-02-16 04:41:05 From: Matthias Bussonnier Date: 2016-02-16 04:41:05 Subject: [PATCH] Force nocolor in some cases. will help for the refactoring using pygments. --- diff --git a/IPython/terminal/embed.py b/IPython/terminal/embed.py index bc232e0..85dc9d1 100644 --- a/IPython/terminal/embed.py +++ b/IPython/terminal/embed.py @@ -270,6 +270,7 @@ def embed(**kwargs): if config is None: config = load_default_config() config.InteractiveShellEmbed = config.TerminalInteractiveShell + config.InteractiveShellEmbed.colors='nocolor' kwargs['config'] = config #save ps1/ps2 if defined ps1 = None diff --git a/IPython/terminal/tests/test_embed.py b/IPython/terminal/tests/test_embed.py index 2767392..5103c47 100644 --- a/IPython/terminal/tests/test_embed.py +++ b/IPython/terminal/tests/test_embed.py @@ -64,7 +64,7 @@ def test_nest_embed(): ipy_prompt = r']:' #ansi color codes give problems matching beyond this - child = pexpect.spawn('%s -m IPython'%(sys.executable, )) + child = pexpect.spawn('%s -m IPython --colors=nocolor'%(sys.executable, )) child.expect(ipy_prompt) child.sendline("from __future__ import print_function") child.expect(ipy_prompt) @@ -123,3 +123,5 @@ def test_nest_embed(): child.sendline("print('true' if IPython.get_ipython() is ip0 else 'false')") assert(child.expect(['true\r\n', 'false\r\n']) == 0) child.expect(ipy_prompt) + child.sendline('exit') + child.close()