MCPcopy Create free account
hub / github.com/ipython/ipython / test_logstart_inaccessible_file

Function test_logstart_inaccessible_file

IPython/core/tests/test_logger.py:9–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7from IPython.utils.tempdir import TemporaryDirectory
8
9def test_logstart_inaccessible_file():
10 try:
11 _ip.logger.logstart(logfname="/") # Opening that filename will fail.
12 except IOError:
13 pass
14 else:
15 nt.assert_true(False) # The try block should never pass.
16
17 try:
18 _ip.run_cell("a=1") # Check it doesn't try to log this
19 finally:
20 _ip.logger.log_active = False # If this fails, don't let later tests fail
21
22def test_logstart_unicode():
23 with TemporaryDirectory() as tdir:

Callers

nothing calls this directly

Calls 2

logstartMethod · 0.45
run_cellMethod · 0.45

Tested by

no test coverage detected