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

Function test_hist_file_config

IPython/core/tests/test_history.py:176–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 nt.assert_true(isinstance(info[1], datetime))
175
176def test_hist_file_config():
177 cfg = Config()
178 tfile = tempfile.NamedTemporaryFile(delete=False)
179 cfg.HistoryManager.hist_file = tfile.name
180 try:
181 hm = HistoryManager(shell=get_ipython(), config=cfg)
182 nt.assert_equal(hm.hist_file, cfg.HistoryManager.hist_file)
183 finally:
184 try:
185 os.remove(tfile.name)
186 except OSError:
187 # same catch as in testing.tools.TempFileMixin
188 # On Windows, even though we close the file, we still can't
189 # delete it. I have no clue why
190 pass
191
192def test_histmanager_disabled():
193 """Ensure that disabling the history manager doesn't create a database."""

Callers

nothing calls this directly

Calls 3

HistoryManagerClass · 0.90
get_ipythonFunction · 0.50
removeMethod · 0.45

Tested by

no test coverage detected