##// END OF EJS Templates
Workaround argparse changed text in Python 3.10...
Workaround argparse changed text in Python 3.10 “optional arguments” was replaced with “options” in argparse help. https://docs.python.org/3/whatsnew/3.10.html#argparse https://bugs.python.org/issue9694

File last commit:

r26750:7b2546d2
r27059:8134c2eb
Show More
test_logger.py
30 lines | 864 B | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""Test IPython.core.logger"""
import os.path
import pytest
from IPython.utils.tempdir import TemporaryDirectory
def test_logstart_inaccessible_file():
try:
_ip.logger.logstart(logfname="/") # Opening that filename will fail.
except IOError:
pass
else:
assert 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()