(hmmax2)
| 454 | |
| 455 | |
| 456 | def test_calling_run_cell(hmmax2): |
| 457 | ip = get_ipython() |
| 458 | with TemporaryDirectory() as tmpdir: |
| 459 | tmp_path = Path(tmpdir) |
| 460 | hist_manager_ori = ip.history_manager |
| 461 | hist_file = tmp_path / "history_test_history1.sqlite" |
| 462 | try: |
| 463 | ip.history_manager = HistoryManager(shell=ip, hist_file=hist_file) |
| 464 | import time |
| 465 | |
| 466 | session_number = ip.history_manager.session_number |
| 467 | ip.run_cell(raw_cell="get_ipython().run_cell(raw_cell='1', store_history=True)", store_history=True) |
| 468 | while ip.history_manager.db_input_cache: |
| 469 | time.sleep(0) |
| 470 | new_session_number = ip.history_manager.session_number |
| 471 | finally: |
| 472 | # Ensure saving thread is shut down before we try to clean up the files |
| 473 | ip.history_manager.end_session() |
| 474 | # Forcibly close database rather than relying on garbage collection |
| 475 | ip.history_manager.save_thread.stop() |
| 476 | ip.history_manager.db.close() |
| 477 | |
| 478 | ip.history_manager = hist_manager_ori |
| 479 | assert session_number == new_session_number, ValueError(f"{session_number} != {new_session_number}") |
| 480 | |
| 481 | |
| 482 | def _make_history_db(hist_file: Path, n_entries: int) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…