##// END OF EJS Templates
Show (Call) Signature of object first....
Show (Call) Signature of object first. When user press Shift+Tab to call up a Tooltip to show the information of a function/method/callable object, I suggest IPython display (Call) Signature fist, so that users can know to call the function quickly. For object with much information, the (Call) Signature will be hidden in Jupyter Notebook.

File last commit:

r7115:a8a64ebc
r22852:ee66c768
Show More
test_logger.py
32 lines | 917 B | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""Test IPython.core.logger"""
import os.path
import nose.tools as nt
from IPython.utils.tempdir import TemporaryDirectory
_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
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()