Ensure that disabling the history manager doesn't create a database.
(hmmax2)
| 351 | |
| 352 | |
| 353 | def test_histmanager_disabled(hmmax2): |
| 354 | """Ensure that disabling the history manager doesn't create a database.""" |
| 355 | cfg = Config() |
| 356 | cfg.HistoryAccessor.enabled = False |
| 357 | |
| 358 | ip = get_ipython() |
| 359 | with TemporaryDirectory() as tmpdir: |
| 360 | hist_manager_ori = ip.history_manager |
| 361 | hist_file = Path(tmpdir) / "history.sqlite" |
| 362 | cfg.HistoryManager.hist_file = hist_file |
| 363 | try: |
| 364 | ip.history_manager = HistoryManager(shell=ip, config=cfg) |
| 365 | hist = ["a=1", "def f():\n test = 1\n return test", "b='€Æ¾÷ß'"] |
| 366 | for i, h in enumerate(hist, start=1): |
| 367 | ip.history_manager.store_inputs(i, h) |
| 368 | assert ip.history_manager.input_hist_raw == [""] + hist |
| 369 | ip.history_manager.reset() |
| 370 | ip.history_manager.end_session() |
| 371 | finally: |
| 372 | ip.history_manager = hist_manager_ori |
| 373 | |
| 374 | # hist_file should not be created |
| 375 | assert hist_file.exists() is False |
| 376 | |
| 377 | |
| 378 | def test_get_tail_session_awareness(hmmax3): |
nothing calls this directly
no test coverage detected
searching dependent graphs…