##// END OF EJS Templates
First step in reintegrating Jedi...
First step in reintegrating Jedi If Jedi is installed expose a private API use it with prompt toolkit. Jedi does not _yet_ provide all the completion IPython has, so this is still a bit awkward. In order to debug this (and see what is Jedi provided we for now inject a fake Jedi/IPython delimiter in the menu. Jedi completion and this behavior are enabled by default, but could likely be opt-in. Add also a number of debug flags to be able to track why jedi is not working, and/or what completions are found by IPython and not Jedi. That should give us a bit of heads up and feedback to know whether we can remove part of the IPython completer, and more especially if we can drop `python_matches`. Once `python_matches` is dropped and some other of the current matchers are either dropped or converted to the new API, that should simplify the internal quite a bit. That would just be too much for an already BIG pull-request.

File last commit:

r7115:a8a64ebc
r23284:3ff1be2e
Show More
test_logger.py
32 lines | 917 B | text/x-python | PythonLexer
Fernando Perez
Add missing encoding declaration to file with unicode in it.
r7115 # -*- coding: utf-8 -*-
Thomas Kluyver
Add test that, if we failed to open the log file, we don't try to write to it.
r3889 """Test IPython.core.logger"""
Thomas Kluyver
Add test for unicode in logging.
r7082 import os.path
Thomas Kluyver
Add test that, if we failed to open the log file, we don't try to write to it.
r3889 import nose.tools as nt
Thomas Kluyver
Add test for unicode in logging.
r7082 from IPython.utils.tempdir import TemporaryDirectory
Thomas Kluyver
Add test that, if we failed to open the log file, we don't try to write to it.
r3889
_ip = get_ipython()
def test_logstart_inaccessible_file():
try:
_ip.logger.logstart(logfname="/") # Opening that filename will fail.
except IOError:
pass
else:
nt.assert_true(False) # The try block should never pass.
try:
_ip.run_cell("a=1") # Check it doesn't try to log this
finally:
_ip.logger.log_active = False # If this fails, don't let later tests fail
Thomas Kluyver
Add test for unicode in logging.
r7082
def test_logstart_unicode():
with TemporaryDirectory() as tdir:
logfname = os.path.join(tdir, "test_unicode.log")
_ip.run_cell("'abc€'")
try:
_ip.magic("logstart -to %s" % logfname)
_ip.run_cell("'abc€'")
finally:
_ip.logger.logstop()