##// END OF EJS Templates
Fix clearing output references with `%reset out` (#14133)...
Fix clearing output references with `%reset out` (#14133) This should fix #14129. Namely the second reference to the output is stored in `user_ns_hidden`. That was already cleared during hard `%reset` but was not cleared when using `%reset out`. Manual `gc.collect()` is still required.

File last commit:

r27509:42e22f8e
r28367:7f4fe75c merge
Show More
test_logger.py
27 lines | 776 B | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""Test IPython.core.logger"""
import os.path
import pytest
from tempfile import TemporaryDirectory
def test_logstart_inaccessible_file():
with pytest.raises(IOError):
_ip.logger.logstart(logfname="/") # Opening that filename will fail.
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()